# Build stage
FROM node:20-alpine AS builder

WORKDIR /app

COPY package*.json ./
COPY . .
RUN npm install
RUN npm run build -- --configuration production

# Production stage
FROM nginx:alpine

COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist/frontend/browser /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
