Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # HuggingFace requires non-root user | |
| RUN useradd -m -u 1000 appuser | |
| WORKDIR /app | |
| # Copy requirements first (layer caching) | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install curl for healthchecks | |
| RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* | |
| # Copy source | |
| COPY . . | |
| # Give ownership to appuser | |
| RUN chown -R appuser:appuser /app | |
| USER appuser | |
| # HuggingFace Spaces uses port 7860 | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"] |