Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (43 loc) · 1.68 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (43 loc) · 1.68 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# syntax=docker/dockerfile:1
# pnpm 11 requires Node.js >= 22.13 (uses the built-in node:sqlite module)
FROM node:22-bookworm-slim AS assets
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN corepack enable && corepack prepare pnpm@11.19.0 --activate
# pnpm needs pnpm-workspace.yaml (allowBuilds for adhocracy4, overrides,
# packageExtensions), the lockfile and .npmrc to install correctly.
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
FROM python:3.12-bookworm AS app
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
DJANGO_SETTINGS_MODULE=adhocracy-plus.config.settings.docker
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gdal-bin \
libgdal-dev \
libgeos-dev \
libproj-dev \
libpq-dev \
gettext \
postgresql-client \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements requirements
RUN pip install --no-cache-dir -r requirements/dev.txt
COPY . .
COPY --from=assets /app/adhocracy-plus/static /app/adhocracy-plus/static
RUN python manage.py compilemessages -v0
# Collect static files so the WSGI server (granian) can serve them via
# WhiteNoise; the dev server (runserver) is not used in containers.
RUN python manage.py collectstatic --noinput
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8004
ENTRYPOINT ["/entrypoint.sh"]
CMD ["granian", "--interface", "wsgi", "--host", "0.0.0.0", "--port", "8004", "--log-level", "warning", "adhocracy-plus.config.wsgi:application"]