QuentinL52 commited on
Commit
8db0f76
·
verified ·
1 Parent(s): b1dd4da

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -1
Dockerfile CHANGED
@@ -1,20 +1,37 @@
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
5
  ENV HF_HOME=/app/cache
6
  RUN mkdir -p /app/cache
7
 
 
8
  RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
9
 
 
10
  COPY requirements.txt .
11
-
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
 
14
  COPY . .
15
 
 
16
  RUN chmod +x ./start.sh
17
 
 
18
  EXPOSE 7860
19
 
 
20
  CMD ["./start.sh"]
 
1
+ # On utilise une image Python 3.11, moderne et compatible
2
  FROM python:3.11-slim
3
 
4
+ # Définir le répertoire de travail
5
  WORKDIR /app
6
 
7
+ # --- CORRECTION ---
8
+ # On ajoute le dossier des exécutables Python au PATH du système.
9
+ # C'est la solution standard pour les erreurs "command not found".
10
+ ENV PATH="/root/.local/bin:${PATH}"
11
+
12
+ # --- Le reste de votre fichier est déjà correct ---
13
+
14
+ # Configuration du Cache Hugging Face
15
  ENV HF_HOME=/app/cache
16
  RUN mkdir -p /app/cache
17
 
18
+ # Installation de Redis
19
  RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
20
 
21
+ # Copie et installation des dépendances
22
  COPY requirements.txt .
23
+ # Il est bon de mettre à jour pip avant d'installer les paquets
24
+ RUN pip install --upgrade pip
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Copie du code de l'application
28
  COPY . .
29
 
30
+ # Rendre le script de démarrage exécutable
31
  RUN chmod +x ./start.sh
32
 
33
+ # Exposer le port par défaut de Hugging Face Spaces
34
  EXPOSE 7860
35
 
36
+ # Définir le script de démarrage comme commande principale
37
  CMD ["./start.sh"]