File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM python:3.12.7 AS base
2+
3+ WORKDIR /app
4+
5+ ENV PYTHONDONTWRITEBYTECODE 1
6+ ENV PYTHONUNBUFFERED 1
7+
8+ RUN apt-get update \
9+ && apt-get install -y \
10+ git \
11+ netcat-openbsd \
12+ && rm -rf /var/lib/apt/lists/*
13+
14+ COPY ./requirements.txt .
15+ COPY ./requirements-dev.txt .
16+ RUN pip install -r requirements-dev.txt
17+
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+ COPY ./entrypoint.sh .
34+ ENTRYPOINT ["/app/entrypoint.sh" ]
35+
36+
37+ FROM dev AS server
38+ ENV RUN_MODE=prod
39+
40+ COPY . .
Original file line number Diff line number Diff line change 1+ # Don't include react app in Django container
2+ /registration-frontend-react
3+
4+ .env
5+ /docker-compose.yaml
6+ /compose.yaml
7+ /Dockerfile
8+ /Dockerfile.dockerignore
9+ /*.sqlite3
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ if [ " $DJANGO_DATABASE_ENGINE " = " django.db.backends.postgresql" ]; then
4+ echo " Waiting for postgres..."
5+ while ! nc -z $DJANGO_DATABASE_HOST " ${DJANGO_DATABASE_PORT:- 5432} " ; do
6+ sleep 0.1
7+ done
8+
9+ echo " PostgreSQL is running chief!"
10+ fi
11+
12+ python manage.py migrate
13+
14+ python manage.py check --deploy
15+
16+ exec " $@ "
17+
You can’t perform that action at this time.
0 commit comments