From 857d6fcd393dc3923699bded64c8d84482701a51 Mon Sep 17 00:00:00 2001 From: Guus van de Steeg Date: Mon, 20 Apr 2026 16:38:20 +0100 Subject: [PATCH] add Dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68d2199 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +######################################################################### +# Mount a config.json file into the container if running outside of K8s # +######################################################################### +FROM gitlab-registry.internal.sanger.ac.uk/sanger-pathogens/shelf/docker-registry/python:3.12-alpine +LABEL email="paminfo-devs@sanger.ac.uk" + +ARG SERVICE_USER="paso" +ARG SERVICE_GROUP="$SERVICE_USER" +# These must be set to match the permissions provided within k8s +ARG UID=1000 +ARG GID=1000 + +USER root +WORKDIR /app + +RUN apk update && apk upgrade + +RUN pip install pipenv flask gunicorn mysql-connector datetime + +COPY api.py log.sh ./ +COPY html html + +EXPOSE 80 + +RUN adduser --disabled-password -u $UID -g $GID $SERVICE_USER $SERVICE_GROUP && chown -R $SERVICE_USER /app +USER $SERVICE_USER + +ENV PYTHONPATH="/app" + +ENTRYPOINT ["gunicorn", "-w", "4", "-b", ":80", "api:app"]