Spaces:
Running
Running
| FROM python:3.11-slim | |
| # HF Spaces runs as uid 1000 | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc g++ && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY src/ src/ | |
| COPY models/ models/ | |
| COPY data_processed/ data/processed/ | |
| COPY demo/ demo/ | |
| # Make everything writable for the app user (needed for SQLite DB) | |
| RUN chown -R user:user /app | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "7860"] | |