| FROM python:3.12-slim | |
| # Install Node.js for frontend build | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends curl && \ | |
| curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ | |
| apt-get install -y --no-install-recommends nodejs && \ | |
| apt-get clean && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Build frontend | |
| COPY frontend/package.json frontend/package-lock.json ./frontend/ | |
| RUN cd frontend && npm ci | |
| COPY frontend/ ./frontend/ | |
| RUN cd frontend && npm run build | |
| # Copy backend and example data | |
| COPY app/ ./app/ | |
| COPY example_data/ ./example_data/ | |
| # HF Spaces expects port 7860 | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |