# Step 1: Build the app
FROM node:20-alpine as builder

WORKDIR /app

COPY . .

RUN npm install && npm run build

# Step 2: Serve it with Nginx
FROM nginx:alpine

# Remove default content
RUN rm -rf /usr/share/nginx/html/*

# Copy built files from the previous stage
COPY --from=builder /app/dist /usr/share/nginx/html

EXPOSE 80

