Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]