-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (32 loc) · 1012 Bytes
/
Copy pathDockerfile
File metadata and controls
48 lines (32 loc) · 1012 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
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:22-alpine3.19 AS frontend-build
ENV NODE_OPTIONS=--openssl-legacy-provider
WORKDIR /opt/app
RUN apk update && apk add git
COPY frontend/package.json .
COPY frontend/yarn.lock .
RUN yarn install
COPY frontend .
RUN npm run build
FROM python:3.13-alpine3.22
ENV PYTHONBUFFERED 1
ENV DJANGO_DEBUG False
# Add user
RUN adduser -S -D user
WORKDIR /opt/app/
# Install dependencies
COPY Pipfile.lock ./
RUN pip install --upgrade pipenv \
&& pipenv requirements > requirements.txt \
&& pip install -r requirements.txt \
&& pip uninstall -y pipenv \
&& rm Pipfile.lock requirements.txt
# Copy source files
COPY manage.py .
COPY backend .
COPY --from=frontend-build /opt/app/dist app/static/front
# Collect static files and delete source files
RUN ./manage.py collectstatic --no-input -c
USER user
CMD ./manage.py migrate && ./manage.py wait_for_db \
&& daphne app.asgi:application -b 0.0.0.0 -p 8000; \
celery --app tasks worker --beat --scheduler django --loglevel=info