# syntax=docker/dockerfile:1 FROM node:22-alpine AS base WORKDIR /app # Install dependencies first (layer caching) COPY package.json ./ RUN npm ci --omit=dev && npm cache clean --force # Copy application COPY src ./src # Create non-root user RUN addgroup -S app && adduser -S app -G app USER app # Metadata ENV NODE_ENV=production EXPOSE 3000 # Healthcheck HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1 CMD ["node", "src/server.js"]