tezuesh commited on
Commit
b2dc3fc
·
verified ·
1 Parent(s): 28a9da3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -2
Dockerfile CHANGED
@@ -8,20 +8,37 @@ ENV PYTHONUNBUFFERED=1 \
8
  PATH=/usr/local/cuda/bin:$PATH \
9
  LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
10
 
11
- # Install Python and pip
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  python3 \
14
  python3-pip \
 
 
15
  curl \
 
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
 
 
 
 
 
 
 
 
 
 
18
  # Set up working directory
19
  WORKDIR /app
20
 
21
  # Copy requirements first to leverage Docker cache
22
  COPY requirements.txt .
23
 
24
- # Install Python dependencies
 
 
 
25
  RUN pip3 install --no-cache-dir -r requirements.txt
26
 
27
  # Copy the rest of your application
 
8
  PATH=/usr/local/cuda/bin:$PATH \
9
  LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
10
 
11
+ # Install system dependencies
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  python3 \
14
  python3-pip \
15
+ python3-dev \
16
+ build-essential \
17
  curl \
18
+ ffmpeg \
19
+ libsndfile1 \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
+ # Upgrade pip and install build tools
23
+ RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
24
+
25
+ # Install PyTorch separately first
26
+ RUN pip3 install --no-cache-dir \
27
+ torch==2.4.1 \
28
+ torchaudio==2.4.1 \
29
+ torchvision==0.19.1 \
30
+ --extra-index-url https://download.pytorch.org/whl/cu121
31
+
32
  # Set up working directory
33
  WORKDIR /app
34
 
35
  # Copy requirements first to leverage Docker cache
36
  COPY requirements.txt .
37
 
38
+ # Modify requirements to remove PyTorch packages
39
+ RUN sed -i '/^torch==/d; /^torchaudio==/d; /^torchvision==/d; /^torchdata==/d' requirements.txt
40
+
41
+ # Install remaining Python dependencies
42
  RUN pip3 install --no-cache-dir -r requirements.txt
43
 
44
  # Copy the rest of your application