Spaces:
Paused
Paused
| # Stage 1: Build the Next.js static export | |
| FROM node:20-alpine AS builder | |
| WORKDIR /app | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm ci | |
| # Copy source code | |
| COPY . . | |
| # Build static export (generates 'out' directory) | |
| RUN npm run build | |
| # Stage 2: Serve with nginx | |
| FROM nginx:alpine | |
| # Copy custom nginx config | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| # Copy static files from builder stage | |
| COPY --from=builder /app/out /usr/share/nginx/html/ | |
| # Expose port 7860 (required by Hugging Face Spaces) | |
| EXPOSE 7860 | |
| # Start nginx | |
| CMD ["nginx", "-g", "daemon off;"] | |