# ── Stage 1: build ────────────────────────────────────────── FROM node:20-alpine AS builder WORKDIR /app # Install dependencies COPY package.json ./ RUN npm install # Copy source and build COPY . . RUN npm run build # ── Stage 2: serve ────────────────────────────────────────── FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf # HuggingFace Spaces runs on port 7860 EXPOSE 7860 CMD ["nginx", "-g", "daemon off;"]