-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (19 loc) · 770 Bytes
/
Dockerfile
File metadata and controls
35 lines (19 loc) · 770 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
33
34
35
FROM python:3.13-slim-bookworm AS builder
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY project /app/project
WORKDIR /app/project/
RUN python manage.py collectstatic --noinput
# static files
FROM nginx:1.25-alpine AS webserver
COPY --from=builder /app/static /app/static
COPY nginx.conf /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"]
# django backend
FROM python:3.13-slim-bookworm AS django
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
WORKDIR /app/project/
COPY project /app/project/
WORKDIR /app/project
CMD ["gunicorn", "project.wsgi", "-b", "0.0.0.0:8000", "-w 3"]