This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (36 loc) · 1.24 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# slim image can't be used since we need git to fetch the commit hash
FROM node:20-slim AS build
COPY package.json package-lock.json .npmrc /app/
COPY frontend /app/frontend
WORKDIR /app/frontend
# Install dependencies
RUN npm ci --no-audit
# Build client
RUN npm run build
# Deploy built frontend to Django
FROM python:slim
# Set build arguments
ARG DJANGO_SUPERUSER_USERNAME=admin
ARG DJANGO_SUPERUSER_EMAIL=admin@admin.com
ARG DJANGO_SUPERUSER_PASSWORD=admin
# Set environment variables
ENV DJANGO_SUPERUSER_USERNAME=$DJANGO_SUPERUSER_USERNAME
ENV DJANGO_SUPERUSER_EMAIL=$DJANGO_SUPERUSER_EMAIL
ENV DJANGO_SUPERUSER_PASSWORD=$DJANGO_SUPERUSER_PASSWORD
COPY .docker /scripts
COPY backend /app/backend/
COPY assets/sample_data /app/assets/sample_data
COPY --from=build /app/frontend/dist/ /app/backend/static/
RUN mkdir -p /data \
&& rm -rf /bin/sh \
&& ln -s /bin/bash /bin/sh \
&& ln -s /data /app/backend/data \
&& chmod +x /scripts/*.sh \
&& /scripts/postunpack.sh \
&& rm -rf .dockerenv /scripts/postunpack.sh
WORKDIR /app/backend
RUN pip install -r requirements.txt
EXPOSE 80
ENTRYPOINT [ "/scripts/entrypoint.sh" ]
CMD [ "/scripts/run.sh" ]
LABEL org.opencontainers.image.source = "https://github.com/us-ferferga/PGPI-Grupo3.2"