# ============================================================================= # Build Stage # ============================================================================= FROM node:20-bookworm AS builder WORKDIR /app # Install dependencies first (better layer caching) COPY package*.json ./ RUN npm ci # Copy source and build COPY tsconfig.json ./ COPY src ./src RUN npm run build # ============================================================================= # Production Stage - Using Playwright base image # ============================================================================= FROM mcr.microsoft.com/playwright:v1.57.0-noble AS production WORKDIR /app # Copy built application and dependencies COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/dist ./dist COPY --from=builder /app/package.json ./ # Set timezone (can be overridden via env) ENV TZ=Europe/Warsaw # Run as non-root user (pwuser is Playwright's default user) USER pwuser # Default command CMD ["node", "dist/index.js"]