Skip to content

Commit

Permalink
Fix warnings in the Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiara Rasi committed Nov 21, 2024
1 parent 5012200 commit e9568d2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 18 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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"
]

0 comments on commit e9568d2

Please sign in to comment.