Skip to content

Commit 4c0509c

Browse files
committed
Add more 🐋
1 parent 95f8713 commit 4c0509c

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

Dockerfile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12.7
1+
FROM python:3.12.7 AS base
22

33
WORKDIR /app
44

@@ -15,9 +15,29 @@ COPY ./requirements.txt .
1515
COPY ./requirements-dev.txt .
1616
RUN pip install -r requirements-dev.txt
1717

18+
19+
FROM base AS collectstatic
20+
COPY . .
21+
RUN DJANGO_STATIC_ROOT=/static python manage.py collectstatic --no-input
22+
RUN find /static -ls
23+
24+
FROM ghcr.io/static-web-server/static-web-server:2.33.1 AS static-server
25+
WORKDIR /srv/http
26+
ENV SERVER_ROOT=/srv/http
27+
28+
COPY --from=collectstatic /static /srv/http/static
29+
30+
31+
FROM base AS dev
32+
ENV RUN_MODE=dev
33+
34+
35+
FROM base AS server
36+
ENV RUN_MODE=prod
37+
1838
COPY ./entrypoint.sh .
1939

2040
COPY . .
2141

22-
ENTRYPOINT [ "/app/entrypoint.sh"]
42+
ENTRYPOINT ["/app/entrypoint.sh"]
2343

Dockerfile.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
/registration-frontend-react
33

44
.env
5+
/docker-compose.yaml
6+
/compose.yaml
7+
/Dockerfile
8+
/Dockerfile.dockerignore
9+
/*.sqlite3

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ fi
1111

1212
python manage.py migrate
1313

14+
python manage.py check --deploy
15+
1416
exec "$@"
1517

0 commit comments

Comments
 (0)