| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy backend requirements and install | |
| COPY backend/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy backend code (including the static folder with the frontend build) | |
| COPY backend/ . | |
| # Expose port 7860 for Hugging Face Spaces | |
| EXPOSE 7860 | |
| # Initialize DB and start server | |
| # We run uvicorn on port 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |