File size: 563 Bytes
4bfb09d
 
 
 
 
491b154
 
4bfb09d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM python:3.11-slim

# Dépendances système pour OpenCV headless
RUN apt-get update && apt-get install -y --no-install-recommends \
    libglib2.0-0 \
    libgl1 \
    libglx-mesa0 \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Installer les dépendances Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copier le code de l'API
COPY app.py .

# Copier le modèle
COPY model/ model/

# Port utilisé par Hugging Face Spaces
EXPOSE 7860

# Lancer l'API
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]