Dockerfile.template•748 B
# Generated by DocuMCP - Multi-stage Docker build for {{ssg}} documentation
FROM mcr.microsoft.com/playwright:v1.55.1-focal AS playwright-base
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY . .
RUN npm ci
RUN {{buildCommand}}
# Test stage
FROM playwright-base AS tester
WORKDIR /app
COPY --from=builder /app/{{buildDir}} ./build
COPY playwright.config.ts package*.json ./
COPY tests/e2e ./tests/e2e
RUN npm install -D @playwright/test @axe-core/playwright
CMD ["npx", "playwright", "test"]
# Server stage
FROM nginx:alpine AS server
COPY --from=builder /app/{{buildDir}} /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=5s --timeout=3s CMD wget --spider http://localhost/health || exit 1
CMD ["nginx", "-g", "daemon off;"]