Spaces:
Sleeping
Sleeping
| # --------------------------------------------------------------- | |
| # DevOpsEnv — Hugging Face Spaces Docker container | |
| # Space SDK: Docker | Port: 7860 | |
| # --------------------------------------------------------------- | |
| FROM python:3.11-slim | |
| # Create non-root user for Hugging Face Spaces | |
| RUN useradd -m -u 1000 appuser | |
| WORKDIR /app | |
| # Install Python dependencies first (layer caching) | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY --chown=appuser:appuser . . | |
| USER appuser | |
| # Expose the port HF Spaces expects | |
| EXPOSE 7860 | |
| # Start the FastAPI server (No --reload in production) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |