Adarka commited on
Commit
cbd2b9d
·
verified ·
1 Parent(s): 79d1b4c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -13
Dockerfile CHANGED
@@ -1,22 +1,15 @@
1
  FROM python:3.10-slim
2
 
3
- # Installer dépendances système
4
- RUN apt-get update && apt-get install -y git
5
-
6
- # Créer dossier travail
7
  WORKDIR /app
8
 
9
- # Créer et autoriser le dossier de cache
10
- RUN mkdir -p /app/cache && chmod -R 777 /app/cache
 
11
 
12
- # Définir la variable d'environnement AVANT le chargement du modèle
13
- ENV TRANSFORMERS_CACHE=/app/cache
14
 
15
- # Copier les fichiers
16
  COPY . .
17
 
18
- # Installer les dépendances Python
19
- RUN pip install --no-cache-dir -r requirements.txt
20
-
21
- # Démarrer FastAPI
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ # Installer dépendances système légères
6
+ RUN apt-get update && apt-get install -y --no-install-recommends git && \
7
+ rm -rf /var/lib/apt/lists/*
8
 
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
 
 
12
  COPY . .
13
 
14
+ # Expose le port standard des Spaces
 
 
 
15
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]