Skip to content

LIBERATED AI CHAT

TypeScript
877 B
Raw Blame
# 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;"]