Elalimy commited on
Commit
5a0eea6
·
verified ·
1 Parent(s): af70ba1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -10
Dockerfile CHANGED
@@ -4,14 +4,7 @@ FROM python:3.10-slim
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy requirements.txt before other files to leverage Docker cache
8
- COPY requirements.txt /app/requirements.txt
9
-
10
- # Install dependencies
11
- RUN pip install --upgrade pip && \
12
- pip install --no-cache-dir -r /app/requirements.txt
13
-
14
- # Copy the rest of the application files into the container
15
  COPY . /app
16
 
17
  # Create and set permissions for the uploads and cache directories
@@ -20,8 +13,11 @@ RUN mkdir -p /app/uploads /app/.cache && chmod 777 /app/uploads /app/.cache
20
  # Set environment variable for the cache directory
21
  ENV XDG_CACHE_HOME=/app/.cache
22
 
23
- # Pre-download the model to the cache directory
24
- RUN python -c "from transformers import Wav2Vec2ForCTC; Wav2Vec2ForCTC.from_pretrained('jonatasgrosman/wav2vec2-large-xlsr-53-english')"
 
 
 
25
 
26
  # Expose the application port
27
  EXPOSE 7860
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy application files into the container
 
 
 
 
 
 
 
8
  COPY . /app
9
 
10
  # Create and set permissions for the uploads and cache directories
 
13
  # Set environment variable for the cache directory
14
  ENV XDG_CACHE_HOME=/app/.cache
15
 
16
+ # Install system dependencies and Python packages
17
+ RUN apt-get update && apt-get install -y \
18
+ ffmpeg \
19
+ && rm -rf /var/lib/apt/lists/* \
20
+ && pip install --no-cache-dir -r requirements.txt
21
 
22
  # Expose the application port
23
  EXPOSE 7860