OUAREDAEK commited on
Commit
1495a94
·
verified ·
1 Parent(s): 33c5f3c

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -1,18 +1,22 @@
1
- # Base image recommended by Hugging Face
2
  FROM python:3.10-slim
3
 
 
4
  ENV PYTHONDONTWRITEBYTECODE=1
5
  ENV PYTHONUNBUFFERED=1
6
 
 
7
  WORKDIR /app
8
 
9
- RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
10
-
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
 
14
  COPY . .
15
 
 
16
  EXPOSE 7860
17
 
18
- CMD ["python", "app.py"]
 
 
1
+ # Image Python officielle
2
  FROM python:3.10-slim
3
 
4
+ # Empêche Python d'écrire des .pyc et force les logs immédiats
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
 
8
+ # Répertoire de travail
9
  WORKDIR /app
10
 
11
+ # Installation des dépendances
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copier le reste de l'application
16
  COPY . .
17
 
18
+ # Port utilisé par Hugging Face Spaces
19
  EXPOSE 7860
20
 
21
+ # Lancement de l'application Flask avec Gunicorn
22
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]