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:
+11
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user