licorne2lc commited on
Commit
6c29ba6
·
1 Parent(s): 8054e11
Files changed (1) hide show
  1. Dockerfile +13 -5
Dockerfile CHANGED
@@ -1,10 +1,18 @@
1
- FROM python:3.10.10
 
2
 
 
3
  WORKDIR /home/app
4
 
5
- COPY requirements.txt /dependencies/requirements.txt
6
- RUN pip install -r /dependencies/requirements.txt
 
7
 
8
- COPY . /home/app
 
9
 
10
- CMD gunicorn app:app --bind 0.0.0.0:$PORT --worker-class uvicorn.workers.UvicornWorker
 
 
 
 
 
1
+ # Image officielle, légère et maintenue
2
+ FROM python:3.10-slim
3
 
4
+ # Définir le répertoire de travail
5
  WORKDIR /home/app
6
 
7
+ # Copier et installer les dépendances
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copier le reste de l’application
12
+ COPY . .
13
 
14
+ # Définir la variable d’environnement pour Hugging Face
15
+ ENV PORT=7860
16
+
17
+ # Lancer le serveur avec Gunicorn + Uvicorn
18
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--worker-class", "uvicorn.workers.UvicornWorker"]