# ---- build ---- FROM docker.io/library/node:22-bookworm-slim AS build WORKDIR /build COPY package*.json ./ RUN npm ci COPY . . # Root deploys (own port, no reverse-proxy prefix) leave this unset and default to '/'. ARG VITE_BASE=/ ENV VITE_BASE=$VITE_BASE RUN npm run build # ---- runtime ---- # Unprivileged nginx (uid 101, no capabilities needed to serve :8097), with the # njs module the /fips/ gateway uses. FROM docker.io/nginxinc/nginx-unprivileged:1.30.6-alpine COPY nginx.conf /etc/nginx/nginx.conf COPY njs/fips.js /etc/nginx/njs/fips.js COPY --from=build /build/dist /usr/share/nginx/html EXPOSE 8097 HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ CMD wget -qO- http://localhost:8097/healthz >/dev/null || exit 1