jmanhype
commited on
Commit
Β·
8fbdd85
1
Parent(s):
f4beea0
refactor: update Dockerfile to install dependencies incrementally with better error handling
Browse files- scripts/gradio/Dockerfile +30 -29
scripts/gradio/Dockerfile
CHANGED
@@ -1,50 +1,51 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
# Install basic dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
wget \
|
6 |
git \
|
7 |
-
python3 \
|
8 |
-
python3-pip \
|
9 |
ffmpeg \
|
10 |
libsm6 \
|
11 |
libxext6 \
|
|
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
-
|
15 |
-
RUN
|
16 |
-
|
|
|
|
|
17 |
|
18 |
-
# Set up git config
|
19 |
RUN git config --global user.email "[email protected]" && \
|
20 |
git config --global user.name "jmanhype"
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
|
28 |
-
RUN pip3 install --no-cache-dir -r requirements.txt
|
29 |
-
RUN pip3 install --no-cache-dir gradio spaces
|
30 |
|
31 |
-
# Install
|
32 |
-
RUN
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
#
|
38 |
-
|
|
|
39 |
|
40 |
-
#
|
41 |
-
|
|
|
42 |
|
43 |
-
|
44 |
-
|
45 |
|
46 |
-
# Expose port
|
47 |
EXPOSE 7860
|
48 |
|
49 |
-
|
50 |
-
CMD ["python3", "scripts/gradio/app_gradio_space.py"]
|
|
|
1 |
+
FROM continuumio/miniconda3:latest
|
2 |
|
|
|
3 |
RUN apt-get update && apt-get install -y \
|
4 |
wget \
|
5 |
git \
|
|
|
|
|
6 |
ffmpeg \
|
7 |
libsm6 \
|
8 |
libxext6 \
|
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"]
|
|