Spaces:
Sleeping
Sleeping
File size: 704 Bytes
b510add f3e22ea b510add | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | FROM python:3.11-slim
WORKDIR /app
# libgl1/libglib nécessaires au runtime d'opencv-python-headless sur Debian slim
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
# CPU-only : évite de télécharger les wheels PyTorch CUDA (inutiles sur Hugging Face Spaces gratuit)
RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
COPY app/ app/
COPY monitoring/ monitoring/
COPY models/ models/
# 7860 = port par défaut attendu par Hugging Face Spaces (Docker SDK)
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|