# Build stage FROM node:20 AS build-stage WORKDIR /app COPY package*.json ./ RUN npm install COPY . . # Set build-time variables for Vite ARG VITE_API_URL ENV VITE_API_URL=$VITE_API_URL RUN npm run build # Production stage FROM nginx:stable-alpine as production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html # Default nginx config is usually enough for simple SPAs # But we might need a custom config for client-side routing # For now, keeping it basic as per standard Vite/Nginx pattern EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]