# Stage 1: Build Vite React App FROM node:20-alpine AS builder WORKDIR /app COPY update-version.js . COPY frontend/package*.json frontend/ WORKDIR /app/frontend RUN npm install COPY frontend/ . RUN npm run build # Stage 2: Serve static files with high-performance Nginx on port 3013 FROM nginx:alpine COPY --from=builder /app/frontend/dist /usr/share/nginx/html # Simple internal Nginx routing for single-page React router stability RUN echo 'server { listen 3013; location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf EXPOSE 3013 CMD ["nginx", "-g", "daemon off;"]