# Build stage FROM node:16-alpine as build-stage WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm config set registry https://registry.npmjs.org/ && npm install # Copy project files COPY . . # Build the application RUN npm run build # Production stage FROM nginx:alpine # Copy built files from build stage COPY --from=build-stage /app/dist /usr/share/nginx/html # Copy nginx configuration COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]