| FROM python:3.10-slim | |
| # Hugging Face optimized - Lightweight without Chrome | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV SPACE_ID=huggingface | |
| ENV HF_SPACE=1 | |
| # Install minimal dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Create user for Hugging Face | |
| RUN useradd -m -u 1000 user | |
| RUN chown -R user:user /app | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Copy application | |
| COPY --chown=user:user . . | |
| # Hugging Face uses port 7860 | |
| EXPOSE 7860 | |
| ENV PORT=7860 | |
| # Start without FlareSolverr (too heavy for HF) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |