| FROM python:3.11-slim | |
| # 🔥 casse le cache build (important HF) | |
| ARG CACHE_BUST=1 | |
| # user sécurisé | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| ENV PORT=7860 | |
| WORKDIR /app | |
| # install deps proprement | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # copy code | |
| COPY --chown=user . . | |
| # start fastapi (simple + stable) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |