-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (27 loc) · 971 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM clinicalgenomics/python3.12-venv:1.0
LABEL about.home="https://github.com/Clinical-Genomics/schug"
LABEL about.license="MIT License (MIT)"
# Install base dependencies
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install -y --no-install-recommends default-libmysqlclient-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# make sure all messages always reach console
ENV PYTHONUNBUFFERED=1
# Create a worker user
RUN groupadd --gid 1000 worker && useradd -g worker --uid 1000 --create-home worker
# Install and run commands from virtual environment
RUN python3 -m venv /home/worker/venv
ENV PATH="/home/worker/venv/bin:$PATH"
# Install app
WORKDIR /home/worker/app
COPY --chown=worker:worker . /home/worker/app
RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction
# Run commands as non-root
USER worker
CMD gunicorn\
--config gunicorn.conf.py \
schug.main:app