29 lines
1.1 KiB
Docker
29 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:24-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --no-audit --no-fund
|
|
COPY . .
|
|
ARG SITE_URL=https://proton-gallery.narl.io
|
|
ENV SITE_URL=$SITE_URL
|
|
RUN npm run build
|
|
|
|
FROM nginxinc/nginx-unprivileged:stable-alpine
|
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
|
COPY docker/security-headers.conf /etc/nginx/security-headers.conf
|
|
COPY docker/40-legal-notice.sh /docker-entrypoint.d/40-legal-notice.sh
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY --from=build /app/dist/impressum/index.html /opt/legal-templates/impressum/index.html
|
|
COPY --from=build /app/dist/datenschutz/index.html /opt/legal-templates/datenschutz/index.html
|
|
|
|
# Only the two legal pages are rewritten at start-up; everything else stays read-only.
|
|
USER root
|
|
RUN rm -f /etc/nginx/conf.d/default.conf \
|
|
&& chown 101:101 /usr/share/nginx/html/impressum/index.html /usr/share/nginx/html/datenschutz/index.html
|
|
USER 101
|
|
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
|
|
CMD wget -q -O /dev/null http://127.0.0.1:8080/healthz || exit 1
|