Maksim commited on
Commit
36bf876
·
1 Parent(s): 82343b7

Add optimized Dockerfile with pre-built mmcv-full wheel

Browse files
Files changed (4) hide show
  1. .dockerignore +29 -0
  2. Dockerfile +41 -0
  3. requirements.txt +0 -4
  4. setup_environment.sh +21 -0
.dockerignore ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .git
2
+ .gitignore
3
+ README.md
4
+ Dockerfile
5
+ .dockerignore
6
+ __pycache__
7
+ *.pyc
8
+ *.pyo
9
+ *.pyd
10
+ .Python
11
+ env
12
+ pip-log.txt
13
+ pip-delete-this-directory.txt
14
+ .tox
15
+ .coverage
16
+ .coverage.*
17
+ .cache
18
+ nosetests.xml
19
+ coverage.xml
20
+ *.cover
21
+ *.log
22
+ .git
23
+ .mypy_cache
24
+ .pytest_cache
25
+ .hypothesis
26
+
27
+ .DS_Store
28
+ .vscode
29
+ .idea
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ ffmpeg \
6
+ git \
7
+ wget \
8
+ curl \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Set working directory
13
+ WORKDIR /home/user/app
14
+
15
+ # Copy requirements first for better caching
16
+ COPY requirements.txt .
17
+
18
+ # Install PyTorch first
19
+ RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
20
+
21
+ # Install mmcv-full with pre-built wheel (this is the key optimization)
22
+ RUN pip install --no-cache-dir mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch2.0/index.html
23
+
24
+ # Install other dependencies
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
+
27
+ # Copy the application code
28
+ COPY . .
29
+
30
+ # Create necessary directories
31
+ RUN mkdir -p models/musetalk models/musetalkV15 models/syncnet models/dwpose models/face-parse-bisent models/sd-vae models/whisper
32
+
33
+ # Set environment variables
34
+ ENV PYTHONPATH=/home/user/app
35
+ ENV HF_HOME=/home/user/app/.cache/huggingface
36
+
37
+ # Expose port
38
+ EXPOSE 7860
39
+
40
+ # Run the application
41
+ CMD ["python", "app.py"]
requirements.txt CHANGED
@@ -1,6 +1,3 @@
1
- torch>=2.0.0
2
- torchvision
3
- torchaudio
4
  diffusers==0.30.2
5
  accelerate==0.28.0
6
  numpy==1.23.5
@@ -19,7 +16,6 @@ ffmpeg-python
19
  moviepy
20
  tqdm
21
  Pillow
22
- mmcv-full
23
  mmpose
24
  mmdet
25
  mmengine
 
 
 
 
1
  diffusers==0.30.2
2
  accelerate==0.28.0
3
  numpy==1.23.5
 
16
  moviepy
17
  tqdm
18
  Pillow
 
19
  mmpose
20
  mmdet
21
  mmengine
setup_environment.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Install system dependencies
4
+ apt-get update && apt-get install -y \
5
+ ffmpeg \
6
+ git \
7
+ wget \
8
+ curl \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Install PyTorch first
13
+ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
14
+
15
+ # Install mmcv-full with pre-built wheel
16
+ pip install --no-cache-dir mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch2.0/index.html
17
+
18
+ # Install other dependencies
19
+ pip install --no-cache-dir -r requirements.txt
20
+
21
+ echo "Environment setup completed!"