# Production Dockerfile for Admin Service FROM node:18-alpine WORKDIR /app # Install dependencies first (for layer caching) COPY package*.json ./ RUN npm install --production # Copy source code COPY . . # Set environment variables ENV NODE_ENV=production ENV PORT=8080 # Expose Cloud Run default port EXPOSE 8080 # Run as non-root user for security RUN chown -R node:node /app USER node # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1 # Start the server CMD ["npm", "start"]