MuseV / scripts /gradio /Dockerfile
jmanhype
Install MMCM dependencies explicitly before MMCM installation
6ec0d8b
FROM continuumio/miniconda3:latest
# Install system dependencies
RUN apt-get update && apt-get install -y \
wget \
git \
ffmpeg \
libsm6 \
libxext6 \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 1000 user
RUN mkdir -p /home/user/app/scripts/gradio && \
chown -R user:user /home/user/app
# Set working directory
WORKDIR /home/user/app
# Configure git
RUN git config --global user.email "[email protected]" && \
git config --global user.name "jmanhype"
# Clone repository
RUN rm -rf * .* || true && \
git clone https://github.com/TMElyralab/MuseV.git . && \
ls -la scripts/gradio/app_gradio_space.py && \
echo "=== Repository contents ===" && \
ls -la scripts/gradio/
# Create conda environment
RUN conda create -n musev python=3.10 -y && \
echo "conda activate musev" >> ~/.bashrc
# Install setuptools first
RUN conda run -n musev pip install --no-cache-dir setuptools==65.5.1
# Install core dependencies first
RUN conda run -n musev pip install --no-cache-dir \
torch \
torchvision \
torchaudio \
transformers==4.33.1 \
accelerate==0.22.0 \
gradio>=4.0.0 \
spaces \
ninja==1.11.1 \
bitsandbytes==0.41.1 \
xformers==0.0.21 \
omegaconf \
einops \
imageio==2.31.1 \
pandas \
matplotlib \
pynvml==11.5.0 \
moviepy==1.0.3 \
scikit-learn \
librosa==0.10.1 \
ffmpeg-python \
easydict \
mediapipe==0.10.3 \
insightface==0.7.3 \
opencv-python \
Pillow \
protobuf==3.20.3 \
PyYAML \
scipy \
tqdm \
albumentations==1.3.1 \
opencv-contrib-python==4.8.0.76 \
imageio-ffmpeg==0.4.8 \
pytorch-lightning==2.0.8 \
timm==0.9.12 \
safetensors==0.3.3 \
pycocotools \
kornia==0.7.0 \
open_clip_torch==2.20.0 \
torchmetrics==1.1.1 \
invisible-watermark==0.1.5 \
ftfy==6.1.1 \
loguru==0.6.0 \
markupsafe==2.0.1 \
cuid
# Install MMCM dependencies first
RUN conda run -n musev pip install --no-cache-dir basicsr && \
conda run -n musev pip install --no-cache-dir -U openmim && \
conda run -n musev mim install mmengine && \
conda run -n musev mim install "mmcv>=2.0.1" && \
conda run -n musev mim install "mmdet>=3.1.0" && \
conda run -n musev mim install "mmpose>=1.1.0"
# Install git dependencies incrementally
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/diffusers.git@tme
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/tencent-ailab/IP-Adapter.git@main
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/openai/CLIP.git@main
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/controlnet_aux.git@tme
# Now install MMCM after its dependencies are installed
RUN git clone https://github.com/TMElyralab/MMCM.git /tmp/mmcm && \
cd /tmp/mmcm && \
git checkout setup && \
conda run -n musev pip install -e .
# Copy and set up entrypoint
COPY scripts/gradio/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Switch to non-root user
USER user
EXPOSE 7860
ENTRYPOINT ["/entrypoint.sh"]