-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 756 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 756 Bytes
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
FROM maestroserver/maestro-python-gcc AS compile-graviz
RUN apt-get -y update --allow-releaseinfo-change && \
apt-get -y install --no-install-recommends \
pkg-config \
graphviz-dev \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONDONTWRITEBYTECODE=1
WORKDIR /opt/application
RUN python3 -m venv /home/app/venv
ENV PATH="/home/app/venv/bin:$PATH"
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip gunicorn && \
pip3 install --no-cache-dir -r requirements.txt
# production image
FROM python:3.8-slim
COPY --from=compile-graviz /home/app/venv /home/app/venv
ENV PATH="/home/app/venv/bin:$PATH"
RUN useradd --create-home app
WORKDIR /home/app
USER app
COPY ./ ./
CMD ["gunicorn", "--config", "./gunicorn_config.py", "run:app"]