fffiloni commited on
Commit
aad3b56
·
verified ·
1 Parent(s): e2f4895

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -38
Dockerfile CHANGED
@@ -1,60 +1,43 @@
1
- # Use Ubuntu 22.04 as base (Python 3.11 is default)
2
- FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
- # Install system dependencies
7
- RUN apt-get update && apt-get install -y \
8
- python3.11 python3.11-dev python3.11-venv python3-pip \
9
- git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev \
10
- build-essential cmake libboost-all-dev \
11
- && ln -sf /usr/bin/python3.11 /usr/bin/python \
12
- && ln -sf /usr/bin/pip3 /usr/bin/pip
13
 
14
- # Verify Python version
15
- RUN python --version
16
 
17
- # Install a compatible dlib wheel (manylinux_x86_64)
18
- RUN pip install --no-cache-dir \
19
- "dlib==19.10"
20
-
21
- # Set up user
22
  RUN useradd -m -u 1000 user
 
23
  USER user
24
 
25
- # Set environment variables
26
  ENV HOME=/home/user \
27
- PATH=/home/user/.local/bin:$PATH \
28
  PYTHONPATH=$HOME/app \
29
- PYTHONUNBUFFERED=1 \
30
- GRADIO_ALLOW_FLAGGING=never \
31
- GRADIO_NUM_PORTS=1 \
32
- GRADIO_SERVER_NAME=0.0.0.0 \
33
- GRADIO_THEME=huggingface \
34
  GRADIO_SHARE=False \
35
- SYSTEM=spaces
36
 
37
- # Set working directory
38
  WORKDIR $HOME/app
39
 
40
- # Clone the app repo
41
- RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app
42
-
43
- # Download model checkpoints
44
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth
45
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt
 
 
 
46
 
47
- # Install other dependencies
48
- RUN pip install --no-cache-dir \
49
- urllib3 transformers yacs scipy scikit-image scikit-learn \
50
- PyYAML Pillow numpy opencv-python imageio ffmpeg-python av gradio "moviepy<2"
51
-
52
- # Copy app script
53
  COPY app.py .
54
 
55
- # Set CUDA environment variables
56
  ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
57
  ENV CUDA_VISIBLE_DEVICES=0
58
 
59
- # Run the app
60
- CMD ["python", "app.py"]
 
1
+ FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Set the MKL_THREADING_LAYER environment variable to GNU
6
+ ENV MKL_THREADING_LAYER=GNU
 
 
 
 
 
7
 
8
+ RUN apt-get update && apt-get install -y git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev build-essential cmake
 
9
 
 
 
 
 
 
10
  RUN useradd -m -u 1000 user
11
+
12
  USER user
13
 
 
14
  ENV HOME=/home/user \
15
+ PATH=/home/user/.local/bin:$PATH \
16
  PYTHONPATH=$HOME/app \
17
+ PYTHONUNBUFFERED=1 \
18
+ GRADIO_ALLOW_FLAGGING=never \
19
+ GRADIO_NUM_PORTS=1 \
20
+ GRADIO_SERVER_NAME=0.0.0.0 \
21
+ GRADIO_THEME=huggingface \
22
  GRADIO_SHARE=False \
23
+ SYSTEM=spaces
24
 
25
+ # Set the working directory to the user's home directory
26
  WORKDIR $HOME/app
27
 
28
+ RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app
29
+
 
 
30
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth
31
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt
32
+
33
+ # Install dependencies
34
+ RUN pip install --no-cache-dir "urllib3 transformers dlib yacs scipy scikit-image scikit-learn PyYAML Pillow numpy<2 opencv-python imageio ffmpeg-python av moviepy<2 gradio"
35
 
 
 
 
 
 
 
36
  COPY app.py .
37
 
38
+ # Set the environment variable to specify the GPU device
39
  ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
40
  ENV CUDA_VISIBLE_DEVICES=0
41
 
42
+ # Run your app.py script
43
+ CMD ["python", "app.py"]