SamiKLN commited on
Commit
af3d42f
·
verified ·
1 Parent(s): 4d2f3f0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -15
Dockerfile CHANGED
@@ -1,32 +1,31 @@
1
  FROM python:3.9-slim
2
 
3
- WORKDIR C:/Users/user.DESKTOP-OMQ89VA/Desktop/ING/ING3-IAA/Semestre 6/Web Developpement/Ai-web-app/app
 
4
 
5
- # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  poppler-utils \
8
  libmagic1 \
9
  ffmpeg \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Install Python dependencies
13
- COPY requirements.txt .
14
- RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy application
17
- COPY . .
18
 
19
- # Set Python path
20
- ENV PYTHONPATH=/app
 
21
 
22
- # Create upload directory
23
  RUN mkdir -p /app/uploads && \
24
  chmod -R a+rwx /app/uploads
25
 
26
- ENV UPLOAD_FOLDER=/app/uploads
27
- ENV HF_TOKEN=${HF_TOKEN}
28
-
29
  EXPOSE 8000
30
 
31
- # Commande ABSOLUMENT critique - doit correspondre exactement à votre structure
32
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
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 # Chemin absolu
22
+ ENV UPLOAD_FOLDER=/app/uploads # Chemin absolu
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"]