-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
54 lines (44 loc) · 1.97 KB
/
Copy pathDockerfile.gpu
File metadata and controls
54 lines (44 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Digital Human Studio — CUDA image, for hosts with an NVIDIA GPU.
#
# Only worth building if you want MuseTalk (photoreal lip sync) on the server.
# Without a GPU, MuseTalk takes many minutes per clip; on CPU it is not usable in
# practice, which is why the default Dockerfile leaves it out entirely.
#
# The 3.7 GB of weights are NOT baked in — mount a volume at /app/python/models
# and run `bash python/download_models.sh` once, or every image pull drags them
# along.
#
# docker build -f Dockerfile.gpu -t digitalhuman:gpu .
# docker run --gpus all -v models:/app/python/models -p 8137:8137 digitalhuman:gpu
#
# Coolify: point the app at this Dockerfile and enable GPU access on the server.
FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg curl git libgl1 libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN pip install --no-cache-dir \
"fastapi>=0.115" "uvicorn>=0.30" "httpx>=0.27" "python-multipart>=0.0.9" \
diffusers==0.30.2 transformers==4.39.2 accelerate \
librosa soundfile omegaconf einops opencv-python mediapipe \
"huggingface_hub[cli]"
# MuseTalk's own source. We drive its UNet/VAE/Whisper directly but replace its
# DWPose/mmpose landmark step with MediaPipe — so mmcv, mmpose and tensorflow are
# never installed (see python/musetalk_engine.py).
RUN git clone --depth 1 https://github.com/TMElyralab/MuseTalk.git /app/python/repo \
&& ln -sfn ../models /app/python/repo/models
COPY index.html ./
COPY css ./css
COPY js ./js
COPY vendor ./vendor
COPY samples ./samples
COPY python/app.py ./python/app.py
COPY python/musetalk_engine.py ./python/musetalk_engine.py
COPY python/download_models.sh ./python/download_models.sh
ENV HOST=0.0.0.0 \
PORT=8137 \
PYTHONUNBUFFERED=1
EXPOSE 8137
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s \
CMD curl -fsS http://localhost:8137/api/config || exit 1
CMD ["python", "python/app.py"]