jmanhype commited on
Commit
0fdeb58
Β·
1 Parent(s): 8fbdd85

Update Dockerfile with incremental dependency installation and better error handling

Browse files
Files changed (1) hide show
  1. scripts/gradio/Dockerfile +21 -15
scripts/gradio/Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM continuumio/miniconda3:latest
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  wget \
5
  git \
@@ -9,43 +10,48 @@ RUN apt-get update && apt-get install -y \
9
  ninja-build \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN useradd -m -u 1000 user
13
  RUN mkdir -p /home/user/app/scripts/gradio && \
14
  chown -R user:user /home/user/app
15
 
 
16
  WORKDIR /home/user/app
17
 
18
- RUN git config --global user.email "[email protected]" && \
 
19
  git config --global user.name "jmanhype"
20
 
 
21
  RUN rm -rf * .* || true && \
22
  git clone https://github.com/TMElyralab/MuseV.git . && \
23
  ls -la scripts/gradio/app_gradio_space.py && \
24
  echo "=== Repository contents ===" && \
25
  ls -la scripts/gradio/
26
 
 
27
  RUN conda create -n musev python=3.10 -y && \
28
  echo "conda activate musev" >> ~/.bashrc
29
 
 
30
  RUN conda run -n musev pip install --no-cache-dir setuptools==65.5.1
31
 
32
- # Install requirements one by one with error handling
33
- RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/diffusers.git@tme || exit 1
34
- RUN conda run -n musev pip install --no-cache-dir git+https://github.com/tencent-ailab/IP-Adapter.git@main || exit 1
35
- RUN conda run -n musev pip install --no-cache-dir git+https://github.com/openai/CLIP.git@main || exit 1
36
- RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/controlnet_aux.git@tme || exit 1
37
 
38
- # Install MMCM with additional dependencies that might be needed
39
- RUN conda run -n musev pip install --no-cache-dir numpy torch torchvision torchaudio
40
- RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/MMCM.git@setup || exit 1
41
-
42
- # Install remaining requirements from requirements.txt
43
- COPY scripts/gradio/requirements.txt .
44
- RUN conda run -n musev pip install --no-cache-dir -r requirements.txt || exit 1
45
 
 
46
  COPY scripts/gradio/entrypoint.sh /entrypoint.sh
47
  RUN chmod +x /entrypoint.sh
48
 
49
- EXPOSE 7860
 
50
 
51
- CMD ["/entrypoint.sh"]
 
1
  FROM continuumio/miniconda3:latest
2
 
3
+ # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  wget \
6
  git \
 
10
  ninja-build \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Create non-root user
14
  RUN useradd -m -u 1000 user
15
  RUN mkdir -p /home/user/app/scripts/gradio && \
16
  chown -R user:user /home/user/app
17
 
18
+ # Set working directory
19
  WORKDIR /home/user/app
20
 
21
+ # Configure git
22
+ RUN git config --global user.email "[email protected]" && \
23
  git config --global user.name "jmanhype"
24
 
25
+ # Clone repository
26
  RUN rm -rf * .* || true && \
27
  git clone https://github.com/TMElyralab/MuseV.git . && \
28
  ls -la scripts/gradio/app_gradio_space.py && \
29
  echo "=== Repository contents ===" && \
30
  ls -la scripts/gradio/
31
 
32
+ # Create conda environment
33
  RUN conda create -n musev python=3.10 -y && \
34
  echo "conda activate musev" >> ~/.bashrc
35
 
36
+ # Install setuptools first
37
  RUN conda run -n musev pip install --no-cache-dir setuptools==65.5.1
38
 
39
+ # Install dependencies incrementally
40
+ RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/diffusers.git@tme || true
41
+ RUN conda run -n musev pip install --no-cache-dir git+https://github.com/tencent-ailab/IP-Adapter.git@main || true
42
+ RUN conda run -n musev pip install --no-cache-dir git+https://github.com/openai/CLIP.git@main || true
43
+ RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/controlnet_aux.git@tme || true
44
 
45
+ # Install MMCM with additional error handling
46
+ RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/MMCM.git@setup || \
47
+ (echo "MMCM installation failed, retrying with debug output..." && \
48
+ conda run -n musev pip install --no-cache-dir -v git+https://github.com/TMElyralab/MMCM.git@setup)
 
 
 
49
 
50
+ # Copy and set up entrypoint
51
  COPY scripts/gradio/entrypoint.sh /entrypoint.sh
52
  RUN chmod +x /entrypoint.sh
53
 
54
+ # Switch to non-root user
55
+ USER user
56
 
57
+ ENTRYPOINT ["/entrypoint.sh"]