KJ24 commited on
Commit
a84baaf
·
verified ·
1 Parent(s): 073d270

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -1,3 +1,4 @@
 
1
  FROM python:3.10
2
 
3
  # ✅ Installer les outils nécessaires pour llama-cpp
@@ -7,27 +8,27 @@ RUN apt-get update && apt-get install -y \
7
  git \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # ✅ Crée un dossier cache autorisé dans le container (important pour Hugging Face)
11
  ENV HF_HOME=/app/cache
12
  ENV TRANSFORMERS_CACHE=/app/cache
13
  ENV HF_MODULES_CACHE=/app/cache
14
  ENV HF_HUB_CACHE=/app/cache
15
 
16
- # ✅ Crée le dossier de cache avec droits d’accès
17
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
18
 
19
- # Dossier de travail
20
  WORKDIR /app
21
 
22
- # Installer les dépendances
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
- # Copier le code
27
  COPY . .
28
 
29
- # Exposer le port API
30
  EXPOSE 7860
31
 
32
- # Lancer FastAPI
33
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 📦 Image de base
2
  FROM python:3.10
3
 
4
  # ✅ Installer les outils nécessaires pour llama-cpp
 
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # ✅ Rediriger le cache HF vers un dossier autorisé dans le conteneur
12
  ENV HF_HOME=/app/cache
13
  ENV TRANSFORMERS_CACHE=/app/cache
14
  ENV HF_MODULES_CACHE=/app/cache
15
  ENV HF_HUB_CACHE=/app/cache
16
 
17
+ # ✅ Créer le dossier de cache avec accès total
18
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
19
 
20
+ # 📁 Dossier de travail
21
  WORKDIR /app
22
 
23
+ # 🧪 Installer les dépendances
24
  COPY requirements.txt .
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # 🧠 Copier tout le code
28
  COPY . .
29
 
30
+ # 🌐 Exposer le port HTTP
31
  EXPOSE 7860
32
 
33
+ # 🚀 Lancer FastAPI
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]