Dockerfile 334 B

12345678910111213141516
  1. # Stage 1 — build
  2. FROM node:22-alpine AS build
  3. WORKDIR /app
  4. COPY package*.json ./
  5. RUN npm ci
  6. COPY . .
  7. RUN npm run test:run && npm run build
  8. # Stage 2 — serve
  9. FROM nginx:alpine AS serve
  10. COPY --from=build /app/dist /usr/share/nginx/html
  11. COPY nginx.conf /etc/nginx/conf.d/default.conf
  12. EXPOSE 80
  13. CMD ["nginx", "-g", "daemon off;"]