mirror of
https://github.com/elder-plinius/G0DM0D3.git
synced 2026-11-16 07:02:25 +00:00
32 lines
877 B
Docker
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;"]
|