-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·32 lines (23 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
executable file
·32 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Build stage: produce static export (out/)
FROM node:22-alpine AS builder
WORKDIR /app
# Pin pnpm to package.json "packageManager" (avoid corepack fetching pnpm@latest from npm;
# that fetch can fail behind proxies / flaky TLS during docker build).
ARG PNPM_VERSION=10.28.1
RUN npm install -g pnpm@${PNPM_VERSION}
COPY package.json pnpm-lock.yaml* pnpm-workspace.yaml* ./
RUN pnpm install --frozen-lockfile
COPY . .
# Same-origin: default /api/v1. For local port-forward dev use: --build-arg NEXT_PUBLIC_API_BASE_URL=http://localhost:9090/api/v1
ARG NEXT_PUBLIC_API_BASE_URL=
ENV NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}
# If build needs internet (e.g. next/font/google), run: docker build --network=host .
RUN pnpm build
# Run stage: nginx serves static files
FROM nginx:alpine
# SPA: try_files for client-side routes; Next export emits per-route index.html
COPY --from=builder /app/out /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN chown -R nginx:nginx /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]