# Provider-neutral production image for the frontend: static SPA build served # by nginx, which also reverse-proxies /api/v1 to the API (same origin). # # Build contract (owned with the frontend team, see infra/README.md): # - build context is frontend/ and must contain package.json, pnpm-lock.yaml # - `pnpm build` emits the production bundle to frontend/dist # - the named context "infra" must point at infra/ (Compose sets it; CLI # builds pass --build-context infra=./infra) # # Build: # docker build -f infra/docker/Dockerfile.frontend \ # --build-context infra=./infra -t finance-frontend:local frontend FROM node:22-alpine AS build WORKDIR /app RUN npm install --global pnpm@12.4.1 COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm build FROM nginx:1.27-alpine AS runtime COPY --from=infra nginx/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/dist /usr/share/nginx/html EXPOSE 80 HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=12 \ CMD wget -q --spider http://127.0.0.1/ || exit 1