- add try_files fallback to serve index.html for all non-asset paths - proxy /api/ requests to the server container to avoid HTML being returned by nginx for API calls when using full route paths
21 lines
825 B
Docker
21 lines
825 B
Docker
# ── Build stage ───────────────────────────────────────────────────────────────
|
|
FROM node:22-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy root lockfile + workspace manifests so npm ci can resolve the full graph
|
|
COPY package*.json ./
|
|
COPY client/package.json ./client/
|
|
RUN npm ci -w client
|
|
|
|
COPY client ./client
|
|
RUN npm run -w client build
|
|
|
|
# ── Runtime stage ─────────────────────────────────────────────────────────────
|
|
FROM nginx:alpine AS runtime
|
|
|
|
COPY --from=builder /app/client/dist /usr/share/nginx/html
|
|
COPY client/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|