SamiKLN commited on
Commit
774eabd
·
verified ·
1 Parent(s): 5c3884d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -18
Dockerfile CHANGED
@@ -1,31 +1,28 @@
1
  FROM python:3.9-slim
2
 
3
- # Chemin ABSOLU dans le conteneur
4
  WORKDIR /app
 
 
 
5
 
6
- # Installer les dépendances système
7
  RUN apt-get update && apt-get install -y \
8
  poppler-utils \
9
  libmagic1 \
10
  ffmpeg \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copier requirements.txt vers /app dans le conteneur
14
- COPY requirements.txt /app/requirements.txt
15
- RUN pip install --no-cache-dir -r /app/requirements.txt
16
 
17
- # Copier TOUT le contenu vers /app dans le conteneur
18
- COPY . /app/
19
 
20
- # Configurer les variables d'environnement
21
- ENV PYTHONPATH=/app
22
- ENV UPLOAD_FOLDER=/app/uploads
23
 
24
- # Créer le dossier uploads
25
- RUN mkdir -p /app/uploads && \
26
- chmod -R a+rwx /app/uploads
27
-
28
- EXPOSE 8000
29
-
30
- # Commande de démarrage avec chemin absolu
31
- CMD ["uvicorn", "/app/app/main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
  FROM python:3.9-slim
2
 
3
+ # 1. Configuration de base
4
  WORKDIR /app
5
+ ENV PYTHONPATH=/app
6
+ ENV UPLOAD_FOLDER=/app/uploads
7
+ ENV HF_TOKEN=${HF_TOKEN}
8
 
9
+ # 2. Dépendances système
10
  RUN apt-get update && apt-get install -y \
11
  poppler-utils \
12
  libmagic1 \
13
  ffmpeg \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # 3. Dépendances Python
17
+ COPY requirements.txt .
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # 4. Copie de l'application
21
+ COPY . .
22
 
23
+ # 5. Initialisation
24
+ RUN mkdir -p ${UPLOAD_FOLDER} && \
25
+ chmod -R a+rwx ${UPLOAD_FOLDER}
26
 
27
+ # 6. Commande de démarrage (CRITIQUE)
28
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]