SamiKLN commited on
Commit
f419b81
·
verified ·
1 Parent(s): a7a3b0a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -14
Dockerfile CHANGED
@@ -2,33 +2,27 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # 1. Installer les dépendances système
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
- # 2. Créer requirements.txt directement si manquant
13
- RUN if [ ! -f requirements.txt ]; then \
14
- echo "fastapi==0.95.2" > requirements.txt && \
15
- echo "uvicorn==0.22.0" >> requirements.txt && \
16
- echo "python-multipart==0.0.6" >> requirements.txt && \
17
- echo "huggingface-hub==0.16.4" >> requirements.txt && \
18
- echo "PyMuPDF==1.22.5" >> requirements.txt; \
19
- fi
20
-
21
- # 3. Installer les dépendances Python
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # 4. Copier l'application
25
  COPY . .
26
 
27
- # 5. Configuration finale
 
 
 
28
  RUN mkdir -p /app/uploads && \
29
  chmod -R a+rwx /app/uploads
30
 
31
- ENV PYTHONPATH=/app
32
  ENV UPLOAD_FOLDER=/app/uploads
33
  ENV HF_TOKEN=${HF_TOKEN}
34
 
 
2
 
3
  WORKDIR /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