# ========================================= # Stage 1 — Build Vite App # ========================================= FROM node:18-alpine AS builder WORKDIR /app # Install deps COPY package*.json ./ RUN npm install # Copy project files COPY . . # Build app (Production mode) RUN npm run build # ========================================= # Stage 2 — Serve with Nginx (High Performance) # ========================================= FROM nginx:alpine # Copy build artifacts COPY --from=builder /app/dist /usr/share/nginx/html # Copy custom Nginx config for Gzip and Caching # Note: Using nginx.txt as source per user request COPY nginx.txt /etc/nginx/conf.d/default.conf EXPOSE 7860 CMD ["nginx", "-g", "daemon off;"]