fffiloni commited on
Commit
f511784
·
verified ·
1 Parent(s): 52b8d36

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -3,16 +3,17 @@ FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV MKL_THREADING_LAYER=GNU
5
 
6
- # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev \
9
- build-essential cmake g++ python3-dev
 
10
 
11
- # Create a user and switch to it
12
  RUN useradd -m -u 1000 user
13
  USER user
14
 
15
- # Set environment variables
16
  ENV HOME=/home/user \
17
  PATH=/home/user/.local/bin:/usr/local/cuda/bin:$PATH \
18
  PYTHONPATH=$HOME/app \
@@ -29,10 +30,6 @@ ENV HOME=/home/user \
29
  CMAKE_PREFIX_PATH=/usr/local/cuda \
30
  TORCH_CUDA_ARCH_LIST="8.6"
31
 
32
- # Set CUDA environment variables
33
- ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
34
- ENV CUDA_VISIBLE_DEVICES=0
35
-
36
  # Set working directory
37
  WORKDIR $HOME/app
38
 
@@ -47,14 +44,18 @@ RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/
47
  RUN pip install --upgrade pip setuptools wheel
48
  RUN pip install --no-cache-dir urllib3 transformers yacs scipy scikit-image scikit-learn PyYAML Pillow "numpy<2" opencv-python imageio ffmpeg-python av "moviepy<2" gradio
49
 
50
- # Install CMake first (required for dlib)
51
  RUN pip install cmake
52
 
53
- # Install dlib with verbose logging
54
- RUN pip install dlib -vvv
55
 
56
  # Copy application file
57
  COPY app.py .
58
 
 
 
 
 
59
  # Run the application
60
  CMD ["python", "app.py"]
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV MKL_THREADING_LAYER=GNU
5
 
6
+ # Install dependencies, including OpenBLAS
7
  RUN apt-get update && apt-get install -y \
8
  git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev \
9
+ build-essential cmake g++ python3-dev \
10
+ cuda-toolkit-11-7 libopenblas-dev liblapack-dev
11
 
12
+ # Create a user
13
  RUN useradd -m -u 1000 user
14
  USER user
15
 
16
+ # Set CUDA paths
17
  ENV HOME=/home/user \
18
  PATH=/home/user/.local/bin:/usr/local/cuda/bin:$PATH \
19
  PYTHONPATH=$HOME/app \
 
30
  CMAKE_PREFIX_PATH=/usr/local/cuda \
31
  TORCH_CUDA_ARCH_LIST="8.6"
32
 
 
 
 
 
33
  # Set working directory
34
  WORKDIR $HOME/app
35
 
 
44
  RUN pip install --upgrade pip setuptools wheel
45
  RUN pip install --no-cache-dir urllib3 transformers yacs scipy scikit-image scikit-learn PyYAML Pillow "numpy<2" opencv-python imageio ffmpeg-python av "moviepy<2" gradio
46
 
47
+ # Install CMake first
48
  RUN pip install cmake
49
 
50
+ # Force dlib to detect CUDA
51
+ RUN pip install dlib --global-option=build_ext --global-option="-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda" -vvv
52
 
53
  # Copy application file
54
  COPY app.py .
55
 
56
+ # Set CUDA environment variables
57
+ ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
58
+ ENV CUDA_VISIBLE_DEVICES=0
59
+
60
  # Run the application
61
  CMD ["python", "app.py"]