musev-demo / Dockerfile
jmanhype
Fix module imports and directory handling
43e677e
raw
history blame
2.41 kB
FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive
ENV HF_HUB_ENABLE_HF_TRANSFER=0
ENV HUGGINGFACE_HUB_CACHE=/data/huggingface
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
python3-pip \
python3-dev \
ffmpeg \
libsm6 \
libxext6 \
wget \
&& rm -rf /var/lib/apt/lists/*
# Set up a new user
RUN useradd -m -u 1000 user
# Create directories and set permissions
RUN mkdir -p /data/huggingface /data/models && \
chown -R user:user /data
# Switch to user
USER user
# Set environment variables
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH
# Set up workspace
WORKDIR $HOME/app
# Install Python packages
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install additional dependencies
RUN pip install --no-cache-dir openmim && \
mim install mmengine && \
mim install "mmcv>=2.0.1" && \
mim install "mmdet>=3.1.0" && \
mim install "mmpose>=1.1.0"
# Clone and set up MuseV
RUN git clone https://github.com/TMElyralab/MuseV.git /tmp/MuseV && \
mkdir -p MuseV && \
cp -r /tmp/MuseV/* MuseV/ && \
cd MuseV && \
git clone https://github.com/huggingface/diffusers.git && \
git clone https://github.com/patrickvonplaten/controlnet_aux.git && \
cd diffusers && pip install -e . && \
cd ../controlnet_aux && pip install -e . && \
cd .. && \
cp -r scripts/gradio/gradio_video2video.py ../gradio_video2video.py && \
cp -r scripts/gradio/gradio_text2video.py ../gradio_text2video.py && \
chmod +x ../gradio_*.py
# Set up Python path
ENV PYTHONPATH="${HOME}/app:${HOME}/app/MuseV:${HOME}/app/MuseV/MMCM:${HOME}/app/MuseV/diffusers/src:${HOME}/app/MuseV/controlnet_aux/src:${HOME}/app/MuseV/scripts/gradio"
# Copy application code
COPY --chown=user:user . .
# Debug information
RUN echo "Current directory:" && pwd && \
echo "Directory contents:" && ls -la && \
echo "MuseV directory contents:" && ls -la MuseV && \
echo "Gradio scripts directory contents:" && ls -la MuseV/scripts/gradio && \
echo "Python path:" && echo $PYTHONPATH && \
echo "Checking gradio scripts:" && ls -la gradio_*.py && \
echo "Verifying file contents:" && \
head -n 1 gradio_video2video.py && \
head -n 1 gradio_text2video.py
EXPOSE 7860
CMD ["python", "-u", "app.py"]