dhruv2842 commited on
Commit
070f657
·
verified ·
1 Parent(s): 2fe777b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -8
Dockerfile CHANGED
@@ -4,25 +4,34 @@ FROM python:3.10-slim
4
  # Prevents Python from writing pyc files to disk and buffers logs immediately
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
- # At the top of your Dockerfile
 
8
  ENV TRANSFORMERS_CACHE=/tmp/huggingface
9
 
10
- # Set working directory in the container
11
  WORKDIR /app
12
 
13
- # Install system dependencies (for audio, etc.)
14
- RUN apt-get update && apt-get install -y ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
15
-
16
- # Copy dependency file first to leverage Docker cache
 
 
 
 
 
 
 
 
17
  COPY requirements.txt .
18
 
19
  # Install Python dependencies
20
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
21
 
22
- # Copy the rest of the app
23
  COPY . .
24
 
25
- # Expose the FastAPI port (Hugging Face prefers 7860, but 8000 is also fine)
26
  EXPOSE 8000
27
 
28
  # Run the app using Uvicorn
 
4
  # Prevents Python from writing pyc files to disk and buffers logs immediately
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
+
8
+ # Hugging Face cache directory
9
  ENV TRANSFORMERS_CACHE=/tmp/huggingface
10
 
11
+ # Set working directory
12
  WORKDIR /app
13
 
14
+ # Install system dependencies for audio and building Python packages
15
+ RUN apt-get update && apt-get install -y \
16
+ gcc \
17
+ g++ \
18
+ make \
19
+ python3-dev \
20
+ portaudio19-dev \
21
+ ffmpeg \
22
+ libsndfile1 \
23
+ && rm -rf /var/lib/apt/lists/*
24
+
25
+ # Copy requirements first to leverage Docker cache
26
  COPY requirements.txt .
27
 
28
  # Install Python dependencies
29
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
30
 
31
+ # Copy the rest of the application code
32
  COPY . .
33
 
34
+ # Expose FastAPI port
35
  EXPOSE 8000
36
 
37
  # Run the app using Uvicorn