Files
G0DM0D3/Dockerfile.web
2026-03-25 10:44:35 -07:00

32 lines
877 B
Docker

# G0DM0D3 Frontend — Static build served by nginx
#
# Stage 1: Build the Next.js static export
# Stage 2: Serve with nginx + proxy API requests to the backend
# ── Build stage ───────────────────────────────────────────
FROM node:20-slim AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
# ── Serve stage ───────────────────────────────────────────
FROM nginx:alpine
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Copy our nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy the static build output
COPY --from=builder /app/out /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]