File size: 955 Bytes
81b0db7
 
e958aad
81b0db7
 
 
 
e958aad
81b0db7
 
 
 
 
 
 
e958aad
81b0db7
 
e958aad
81b0db7
 
e958aad
81b0db7
 
2a8db1d
81b0db7
 
 
 
 
 
6b78b6d
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
28
29
30
31
32
# # Utiliser une image Python 3.11 légère
# FROM python:3.11-slim

# # Créer un utilisateur non-root pour des raisons de sécurité
# RUN useradd -m -u 1000 user
# USER user
# ENV PATH="/home/user/.local/bin:$PATH"

# # Définir le répertoire de travail
# WORKDIR /app

# # Copier uniquement les dépendances d'abord (pour tirer parti du cache Docker)
# COPY --chown=user ./requirements.txt requirements.txt
# # Installer les dépendances Python
# RUN pip install --no-cache-dir --upgrade -r requirements.txt

# # Copier le reste de l'application
# COPY --chown=user . /app

# # **Exposer le port 7860** (obligatoire pour Hugging Face Spaces)
# EXPOSE 7860

# # **Correction** : Remplacer "0..0.0" par "0.0.0.0"
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]


FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]