-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1.44 KB
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1.44 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
# ── Stage 1: frontend build ──────────────────────────────────────────────────
FROM node:20-alpine AS frontend-builder
WORKDIR /build
# Installeer dependencies eerst (betere Docker cache).
# vendor/ bevat de gevendoorde xlsx-tarball waar package.json naar verwijst.
COPY package.json package-lock.json ./
COPY vendor/ ./vendor/
RUN npm ci
# Kopieer broncode en bouw
COPY vite.config.ts tsconfig.json tailwind.config.js postcss.config.js index.html ./
COPY src/ ./src/
RUN npm run build
# ── Stage 2: runtime ─────────────────────────────────────────────────────────
FROM python:3.12-alpine
WORKDIR /app
COPY server.py .
COPY --from=frontend-builder /build/dist/index.html ./static/index.html
COPY entrypoint.sh /entrypoint.sh
# su-exec: lichtgewicht tool om na rechten-fix naar non-root te wisselen.
# /data wordt aangemaakt maar HA overschrijft het volume bij runtime —
# entrypoint.sh herstelt de eigenaar dan alsnog vóór de proces-switch.
RUN apk add --no-cache su-exec \
&& adduser -D -H -s /sbin/nologin appuser \
&& mkdir -p /data \
&& chmod 644 /app/server.py /app/static/index.html \
&& chmod +x /entrypoint.sh
EXPOSE 8099
# Entrypoint draait als root, repareert /data-rechten, daarna su-exec → appuser
CMD ["/entrypoint.sh"]