diff --git a/PythonServer/Dockerfile b/PythonServer/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0b4a6cdbfe9760c5c42e4c008bdb599e7a48e17a --- /dev/null +++ b/PythonServer/Dockerfile @@ -0,0 +1,28 @@ +FROM python:3.7-slim + +RUN groupadd -r -g 1000 csi \ + && useradd --no-log-init -r -g csi -u 1000 csi \ + && mkdir -p /var/www/data \ + && chown csi:csi /var/www/data + +# Install required dependencies +RUN apt-get update \ + && apt-get install -yq --no-install-recommends \ + git \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY requirements.txt /requirements.txt +RUN python3 -m venv /venv \ + && . /venv/bin/activate \ + && pip install -i https://artifactory.esss.lu.se/artifactory/api/pypi/pypi-virtual/simple --no-cache-dir -r /requirements.txt \ + && chown -R csi:csi /venv + +COPY --chown=csi:csi pos-python-server.py /app/ +WORKDIR /app + +ENV PATH /venv/bin:$PATH + +USER csi + +CMD ["python3", "-u", "pos-python-server.py"] diff --git a/PythonServer/requirements-to-freeze.txt b/PythonServer/requirements-to-freeze.txt new file mode 100644 index 0000000000000000000000000000000000000000..c6ea74dbae69b549c695284692c78261f821fb4a --- /dev/null +++ b/PythonServer/requirements-to-freeze.txt @@ -0,0 +1,5 @@ +GitPython +matplotlib +numpy +pyepics +py-epicsarchiver diff --git a/PythonServer/requirements.txt b/PythonServer/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8814b7a2b78a03a4b30c814c61e0be73bbdd037b --- /dev/null +++ b/PythonServer/requirements.txt @@ -0,0 +1,20 @@ +certifi==2019.3.9 +chardet==3.0.4 +Click==7.0 +cycler==0.10.0 +gitdb2==2.0.5 +GitPython==2.1.11 +idna==2.8 +kiwisolver==1.1.0 +matplotlib==3.0.3 +numpy==1.16.3 +pandas==0.24.2 +py-epicsarchiver==0.3.0 +pyepics==3.3.3 +pyparsing==2.4.0 +python-dateutil==2.8.0 +pytz==2019.1 +requests==2.21.0 +six==1.12.0 +smmap2==2.0.5 +urllib3==1.24.2