dreamtalk / Dockerfile
fffiloni's picture
Update Dockerfile
2a798f5 verified
raw
history blame
1.81 kB
# Use Ubuntu 22.04 as base (Python 3.11 is default)
FROM nvidia/cuda:11.8.0-devel-ubuntu25.04
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.11 python3.11-dev python3.11-venv python3-pip \
git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev \
build-essential cmake libboost-all-dev \
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip
# Verify Python version
RUN python --version
# Install a compatible dlib wheel (manylinux_x86_64)
RUN pip install --no-cache-dir \
dlib
# Set up user
RUN useradd -m -u 1000 user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONPATH=$HOME/app \
PYTHONUNBUFFERED=1 \
GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_THEME=huggingface \
GRADIO_SHARE=False \
SYSTEM=spaces
# Set working directory
WORKDIR $HOME/app
# Clone the app repo
RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app
# Download model checkpoints
RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth
RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt
# Install other dependencies
RUN pip install --no-cache-dir \
urllib3 transformers yacs scipy scikit-image scikit-learn \
PyYAML Pillow numpy opencv-python imageio ffmpeg-python av gradio "moviepy<2"
# Copy app script
COPY app.py .
# Set CUDA environment variables
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
ENV CUDA_VISIBLE_DEVICES=0
# Run the app
CMD ["python", "app.py"]