Spaces:
Runtime error
Runtime error
| FROM python:3.11-slim | |
| # Hugging Face Spaces runs on port 7860 | |
| ENV PORT=7860 | |
| # Create a non-root user (required by HF Spaces) | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /home/user/app | |
| # Install dependencies first (cache layer) | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY --chown=user:user . . | |
| # Switch to non-root user | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |