chore: apply Mikael's Dockerfile and nginx.conf improvements

- Dockerfile: add NEXT_PUBLIC_LOOPS_FORM_ID build arg for Loops waitlist integration
- nginx.conf: add RSS feed MIME type, Permissions-Policy header, remove _next/static
  special case (redundant with static asset catch-all)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Mikael Berg
2026-05-20 14:02:15 +00:00
co-authored by Paperclip
parent 8e852fcfd8
commit 3616f8923f
2 changed files with 24 additions and 18 deletions
+11 -3
View File
@@ -1,15 +1,23 @@
# Stage 1: build Next.js static export
# Stage 1: build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --prefer-offline
RUN npm ci --prefer-offline --cache /tmp/npm-cache
COPY . .
# Accept build-time env vars (baked into static output)
ARG NEXT_PUBLIC_LOOPS_FORM_ID
ENV NEXT_PUBLIC_LOOPS_FORM_ID=$NEXT_PUBLIC_LOOPS_FORM_ID
RUN npm run build
# Stage 2: serve with nginx (non-root, port 8080)
# Stage 2: serve
FROM nginx:1.27-alpine
COPY --from=builder /app/out /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
CMD wget -qO- http://localhost:8080/ || exit 1