1 # Step 1: Build Angular in production mode
2 FROM node:18 AS builder
6 # Copy package.json and package-lock.json
10 RUN npm install --force
12 # Copy the rest of the application code
15 # Build the Angular application in production mode
16 RUN npm run build --ignore-scripts -- --output-path=./dist/frontend
18 # Step 2: Serve the built application using Nginx
21 # Copy the built Angular application from the previous step
22 COPY --from=builder /app/dist/frontend /usr/share/nginx/html
24 # Expose port 80 for Nginx