| FROM node:20-alpine AS builder | |
| RUN corepack enable && corepack prepare pnpm@9.12.0 --activate | |
| WORKDIR /app | |
| COPY package.json pnpm-lock.yaml ./ | |
| RUN pnpm install --frozen-lockfile | |
| COPY . . | |
| ARG VITE_API_BASE=/api | |
| ENV VITE_API_BASE=$VITE_API_BASE | |
| RUN pnpm build | |
| FROM nginx:1.27-alpine AS runtime | |
| COPY --from=builder /app/dist /usr/share/nginx/html | |
| COPY nginx.conf /etc/nginx/conf.d/default.conf | |
| EXPOSE 80 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ | |
| CMD wget -q -O - http://localhost/ >/dev/null || exit 1 | |