forked from naturnd-rush/rush-cms-django
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.django
More file actions
47 lines (39 loc) · 1.67 KB
/
Dockerfile.django
File metadata and controls
47 lines (39 loc) · 1.67 KB
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
# Use fixed ubuntu small image version with GDAL and Python pre-installed.
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.11.4
WORKDIR /rush_admin
# Install curl, pipx, and netcat (wait-for-db.sh script needs it.)
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl pipx netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# Add NodeSource repo and install nodejs.
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry (Python package manager) and set it's path manually.
# For some reason, running `pipx ensurepath` doesn't seem to work here.
RUN pipx install poetry
ENV PATH="/root/.local/bin:$PATH"
# Copy Python dependency manifests and install. The `--without os_specific` flag
# skips the Python gdal installation which is already set up for us in the base image.
COPY pyproject.toml poetry.toml poetry.lock ./
RUN poetry lock && poetry install --without os_specific
# Copy node dependency manifests and install.
COPY frontend/package*.json ./frontend/
RUN (cd frontend && npm install)
# Copy the frontend source code, vite config, and build the frontend code.
COPY frontend/src ./frontend/src/
COPY frontend/vite.config.ts ./frontend/
RUN (cd frontend && npx vite build)
# Copy the rest of the project over.
COPY config ./config
COPY rush ./rush
COPY static ./static
COPY templates ./templates
COPY manage.py ./manage.py
COPY pytest.ini ./pytest.ini
COPY wait-for-db.sh /wait-for-db.sh
COPY LICENSE ./LICENSE
# Wait for the postgres database service before executing commands
RUN chmod +x /wait-for-db.sh
ENTRYPOINT ["/wait-for-db.sh"]