Spaces:
Sleeping
Sleeping
| # Build stage | |
| FROM node:20-alpine AS builder | |
| WORKDIR /app | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm ci | |
| # Copy source code | |
| COPY . . | |
| # Build the Vite app with NODE_ENV=development to use staging backend | |
| RUN NODE_ENV=development npm run build | |
| # Production stage - serve static files | |
| FROM node:20-alpine | |
| WORKDIR /app | |
| # Install serve to host static files | |
| RUN npm install -g serve | |
| # Copy built files from builder | |
| COPY --from=builder /app/dist ./dist | |
| # Expose port 7860 (Hugging Face Spaces requirement) | |
| EXPOSE 7860 | |
| # Serve the static files on port 7860 | |
| CMD ["serve", "-s", "dist", "-l", "7860", "--no-clipboard"] | |