devcom33 commited on
Commit
21b49f6
·
1 Parent(s): 438ba6c

Updated FastAPI code

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -1,21 +1,26 @@
1
  FROM python:3.10-slim
2
 
 
 
 
 
 
 
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
  # Copy all files
7
  COPY . .
8
 
9
- # Install Python dependencies
10
  RUN pip install --upgrade pip
11
  RUN pip install --no-cache-dir torch torchvision torchaudio
12
  RUN pip install --no-cache-dir git+https://github.com/pyannote/pyannote-audio.git
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Make a writable cache directory for model downloads
16
  RUN mkdir -p /app/cache
17
-
18
- # Set environment variable to use this cache path (optional but good practice)
19
  ENV HF_HOME=/app/cache
20
  ENV TRANSFORMERS_CACHE=/app/cache
21
  ENV HF_HUB_CACHE=/app/cache
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies including git and ffmpeg (needed by pyannote and audio processing)
4
+ RUN apt-get update && apt-get install -y \
5
+ git \
6
+ ffmpeg \
7
+ libsndfile1 \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
  # Set working directory
11
  WORKDIR /app
12
 
13
  # Copy all files
14
  COPY . .
15
 
16
+ # Upgrade pip and install dependencies
17
  RUN pip install --upgrade pip
18
  RUN pip install --no-cache-dir torch torchvision torchaudio
19
  RUN pip install --no-cache-dir git+https://github.com/pyannote/pyannote-audio.git
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Optional: Set model cache directories
23
  RUN mkdir -p /app/cache
 
 
24
  ENV HF_HOME=/app/cache
25
  ENV TRANSFORMERS_CACHE=/app/cache
26
  ENV HF_HUB_CACHE=/app/cache