KJ24 commited on
Commit
e1329f4
·
verified ·
1 Parent(s): 5f710b6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -14
Dockerfile CHANGED
@@ -1,34 +1,34 @@
1
- # 📦 Image de base
2
  FROM python:3.10
3
 
4
- # ✅ Installer les outils nécessaires pour llama-cpp
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  cmake \
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"]
 
1
+ # 📦 Image de base Python 3.10
2
  FROM python:3.10
3
 
4
+ # ✅ Installer les outils système nécessaires à llama-cpp et transformers
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  cmake \
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # ✅ Configuration du cache HF dans un dossier autorisé
12
+ ENV HF_HOME=/app/cache \
13
+ TRANSFORMERS_CACHE=/app/cache \
14
+ HF_MODULES_CACHE=/app/cache \
15
+ HF_HUB_CACHE=/app/cache
16
 
17
+ # ✅ Création du dossier cache avec accès complet
18
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
19
 
20
+ # 📁 Dossier de travail dans le conteneur
21
  WORKDIR /app
22
 
23
+ # 🧪 Installer les dépendances Python en premier
24
  COPY requirements.txt .
25
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
26
 
27
+ # 🧠 Copier le code de l’application (ex: app.py)
28
  COPY . .
29
 
30
+ # 🌐 Exposer le port HTTP pour l’API FastAPI
31
  EXPOSE 7860
32
 
33
+ # 🚀 Commande de démarrage du serveur Uvicorn
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]