- Replace mock Nitro routes with server-side proxies to the Go API - /plan reads Go /api/staffing; local assumption edits are a labeled preview - /simulate reads base and scenario staffing from Go instead of local multipliers - Route train upload and scenario POST through Nitro with server-only credentials - Keep NUXT_PUBLIC_USE_MOCK=1 as an explicit dev fallback only - Match Go's global-peak flat schedule and add a captured Go parity fixture - Run the web runtime as numeric UID/GID 10001:10001 - Add make check, Gitea CI workflow and a proxy smoke script
34 lines
779 B
Docker
34 lines
779 B
Docker
# Multi-stage production build for the Nuxt SSR server.
|
|
# The runtime image runs as numeric UID/GID 10001:10001 so Kubernetes can
|
|
# verify runAsNonRoot without a named user lookup.
|
|
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runtime
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=3000
|
|
ENV HOME=/tmp
|
|
ENV NITRO_TEMP_DIR=/tmp
|
|
|
|
# Create a numeric runtime identity. Keep the literal numbers in USER/COPY:
|
|
# the kubelet cannot resolve names such as "app" reliably.
|
|
RUN addgroup -g 10001 -S app \
|
|
&& adduser -u 10001 -S app -G app
|
|
|
|
COPY --from=build --chown=10001:10001 /app/.output ./.output
|
|
|
|
USER 10001:10001
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", ".output/server/index.mjs"]
|