forked from upkoding/upkoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (27 loc) · 780 Bytes
/
Dockerfile
File metadata and controls
32 lines (27 loc) · 780 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
# multi stages build
# app base
FROM python:3.9-slim-bullseye as base
WORKDIR /app
COPY . ./
RUN pip3 install -r requirements.txt
# development
FROM base as dev
CMD ["python","manage.py","runserver", "0.0.0.0:8000"]
# build static
FROM node:14-slim as staticfiles
WORKDIR /staticfiles
COPY _static/ .
RUN npm install && npm run build
# production
# built to run on Digital Ocean App Platform:
# - DO default port: 8080
# - DO worker temp dir: /dev/shm
FROM base as prod
WORKDIR /app
COPY --from=staticfiles /staticfiles/dist /app/_static/dist
RUN python3 manage.py collectstatic --noinput
ARG app_version
ENV APP_VERSION=${app_version}
ENV APP_WORKERS 3
ENV PORT 8080
CMD exec gunicorn --bind :$PORT --workers $APP_WORKERS --worker-tmp-dir=/dev/shm upkoding.wsgi:application