# Stage 1: Build the application FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN rm package-lock.json && \ sed -i '/@rollup\/rollup-darwin-arm64/d' package.json && \ npm install COPY . . RUN npm run build # Stage 2: Serve with Nginx FROM nginx:alpine # Copy built assets from builder stage COPY --from=builder /app/dist /usr/share/nginx/html # Copy custom nginx config COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]