# Build stage FROM node:18-alpine AS builder WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm ci --prefer-offline --no-audit # Copy source code COPY . . # Build the application RUN npm run build # Production stage FROM node:18-alpine WORKDIR /app # Install a simple HTTP server to serve the built app RUN npm install -g serve # Copy built app from builder stage COPY --from=builder /app/dist ./dist EXPOSE 3000 # Serve the built app CMD ["serve", "-s", "dist", "-l", "3000"]