-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathDockerfile
29 lines (23 loc) · 1.02 KB
/
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
# ------------------------------------------------------------------------------
# Base image
# ------------------------------------------------------------------------------
FROM python:3.8-slim AS base
# ------------------------------------------------------------------------------
# Install dependencies
# ------------------------------------------------------------------------------
FROM base AS deps
COPY requirements.txt ./
RUN apt update > /dev/null && \
apt install -y build-essential && \
pip install --disable-pip-version-check -r requirements.txt
# ------------------------------------------------------------------------------
# Final image
# ------------------------------------------------------------------------------
FROM base
WORKDIR /usr/src/app
COPY . /usr/src/app
COPY --from=deps /root/.cache /root/.cache
RUN pip install --disable-pip-version-check -r requirements.txt && \
rm -rf /root/.cache
EXPOSE 5000
CMD ["gunicorn", "--preload", "-c", "gunicorn.conf.py", "app.main:create_app()"]