dreamtalk / Dockerfile
fffiloni's picture
Update Dockerfile
6b257cf verified
raw
history blame
2.26 kB
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
ENV DEBIAN_FRONTEND=noninteractive
ENV MKL_THREADING_LAYER=GNU
# Install dependencies, including OpenBLAS
RUN apt-get update && apt-get install -y \
git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev \
build-essential cmake g++ python3-dev
RUN apt-get update && apt-get install -y \
software-properties-common && \
add-apt-repository -y ppa:graphics-drivers/ppa && \
apt-get update && apt-get install -y \
cuda-command-line-tools-11-7 \
libcusolver-dev-11-7 \
libcublas-dev-11-7 \
libcudnn8
# Create a user
RUN useradd -m -u 1000 user
USER user
# Set CUDA paths
ENV HOME=/home/user \
PATH=/home/user/.local/bin:/usr/local/cuda/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 \
CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
CUDA_HOME=/usr/local/cuda \
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \
CMAKE_PREFIX_PATH=/usr/local/cuda \
TORCH_CUDA_ARCH_LIST="8.6"
# Set working directory
WORKDIR $HOME/app
# Clone the repository
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
# Upgrade pip & install dependencies
RUN pip install --upgrade pip setuptools wheel
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
# Install CMake first
RUN pip install cmake
# Force dlib to detect CUDA
RUN pip install dlib --global-option=build_ext --global-option="-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda" -vvv
# Copy application file
COPY app.py .
# Set CUDA environment variables
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
ENV CUDA_VISIBLE_DEVICES=0
# Run the application
CMD ["python", "app.py"]