From e9568d2aa05de08cf3bc9e164e116af6e1de546e Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 21 Nov 2024 12:03:16 +0100 Subject: [PATCH] Fix warnings in the Dockerfile --- CHANGELOG.md | 1 + Dockerfile | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c59bc..2e50f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Fixed - Updated issue templates - Updated a number of libraries to address all current security advisories +- Warnings in the Dockerfile ## [2.6] ### Added diff --git a/Dockerfile b/Dockerfile index 6b228af..b95714f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ########### # BUILDER # ########### -FROM clinicalgenomics/python3.8-venv:1.0 AS BUILDER +FROM clinicalgenomics/python3.8-venv:1.0 AS builder # Install and run commands from virtual environment RUN python3 -m venv /home/worker/venv @@ -16,10 +16,10 @@ RUN poetry install --no-interaction ######### # FINAL # ######### -FROM clinicalgenomics/python3.8-venv:1.0 AS DEPLOYER +FROM clinicalgenomics/python3.8-venv:1.0 RUN groupadd --gid 1000 worker && useradd -g worker --uid 1000 --create-home worker -COPY --chown=worker:worker --from=BUILDER /home/worker/venv /home/worker/venv +COPY --chown=worker:worker --from=builder /home/worker/venv /home/worker/venv RUN mkdir /home/worker/app WORKDIR /home/worker/app @@ -37,16 +37,18 @@ ENV GUNICORN_THREADS=1 ENV GUNICORN_BIND="0.0.0.0:8000" ENV GUNICORN_TIMEOUT=400 -CMD gunicorn \ - --workers=$GUNICORN_WORKERS \ - --worker-class=uvicorn.workers.UvicornWorker \ - --bind=$GUNICORN_BIND \ - --threads=$GUNICORN_THREADS \ - --timeout=$GUNICORN_TIMEOUT \ - --proxy-protocol \ - --forwarded-allow-ips="10.0.2.100,127.0.0.1" \ - --log-syslog \ - --access-logfile - \ - --error-logfile - \ - --log-level="debug" \ - preClinVar.main:app +CMD [ + "gunicorn", + "--workers=${GUNICORN_WORKERS}", + "--worker-class=uvicorn.workers.UvicornWorker", + "--bind=${GUNICORN_BIND}", + "--threads=${GUNICORN_THREADS}", + "--timeout=${GUNICORN_TIMEOUT}", + "--proxy-protocol", + "--forwarded-allow-ips=10.0.2.100,127.0.0.1", + "--log-syslog", + "--access-logfile", "-", + "--error-logfile", "-", + "--log-level=debug", + "preClinVar.main:app" +]