SamiKLN commited on
Commit
c745dd7
·
verified ·
1 Parent(s): 30e77a8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -12
Dockerfile CHANGED
@@ -6,27 +6,25 @@ WORKDIR /app
6
  RUN apt-get update && apt-get install -y \
7
  poppler-utils \
8
  libmagic1 \
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Copy requirements first to leverage Docker cache
12
- COPY backend/requirements.txt .
13
-
14
- # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy the rest of the application
18
  COPY . .
19
 
20
- # Set environment variables
 
 
 
 
21
  ENV PYTHONPATH=/app
22
  ENV UPLOAD_FOLDER=/app/uploads
23
- ENV HF_TOKEN=your_huggingface_token_here
24
-
25
- # Create upload directory
26
- RUN mkdir -p ${UPLOAD_FOLDER}
27
 
28
- # Expose the port the app runs on
29
  EXPOSE 8000
30
 
31
- # Command to run the application
32
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
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
+ # Copy requirements FIRST for better caching
13
+ COPY requirements.txt . # Ligne modifiée
 
 
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Copy application
17
  COPY . .
18
 
19
+ # Create upload directory
20
+ RUN mkdir -p /app/uploads && \
21
+ chmod -R a+rwx /app/uploads
22
+
23
+ # Environment variables
24
  ENV PYTHONPATH=/app
25
  ENV UPLOAD_FOLDER=/app/uploads
26
+ ENV HF_TOKEN=${HF_TOKEN}
 
 
 
27
 
 
28
  EXPOSE 8000
29
 
 
30
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]