This commit is contained in:
Felix Klement committed 2026-10-04 22:29:17 +02:00
1 parent cc41849cf5
commit f84687d745
22 files changed
+555 -14

No files matched your search

+12 -1
View File
@@ -10,10 +10,21 @@ RUN npm ci --no-audit --no-fund
COPY . .
RUN npm run build
# Serve dist/ with nginx.
# The contact handler's production dependencies (nodemailer only).
FROM node:22-alpine AS contact
WORKDIR /srv/contact
COPY server/package.json server/package-lock.json ./
RUN npm ci --omit=dev --no-audit --no-fund
COPY server/contact.mjs ./
# Serve dist/ with nginx; POST /contact goes to the handler on 127.0.0.1:3000.
FROM nginx:1.27-alpine AS runtime
RUN apk add --no-cache nodejs
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY docker/entrypoint.sh /entrypoint.sh
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=contact /srv/contact /srv/contact
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://127.0.0.1/healthz || exit 1