jmanhype
commited on
Commit
Β·
f0aa467
1
Parent(s):
820874d
Simplify Dockerfile to use anchorxia/musev base image with minimal Space requirements
Browse files- Dockerfile +44 -10
- scripts/gradio/entrypoint.sh +6 -11
Dockerfile
CHANGED
@@ -1,18 +1,52 @@
|
|
1 |
-
FROM anchorxia/musev:
|
2 |
|
3 |
#MAINTAINER η»΄ζ€θ
δΏ‘ζ―
|
4 |
-
LABEL MAINTAINER="anchorxia"
|
5 |
-
LABEL Email="[email protected]"
|
6 |
-
LABEL Description="musev
|
7 |
-
ARG DEBIAN_FRONTEND=noninteractive
|
8 |
-
|
9 |
-
USER root
|
10 |
|
11 |
SHELL ["/bin/bash", "--login", "-c"]
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
RUN . /opt/conda/etc/profile.d/conda.sh \
|
14 |
&& echo "source activate musev" >> ~/.bashrc \
|
15 |
&& conda activate musev \
|
16 |
-
&& conda env list
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM anchorxia/musev:latest
|
2 |
|
3 |
#MAINTAINER η»΄ζ€θ
δΏ‘ζ―
|
4 |
+
LABEL MAINTAINER="anchorxia, zhanchao"
|
5 |
+
LABEL Email="[email protected], [email protected]"
|
6 |
+
LABEL Description="musev gradio image, from docker pull anchorxia/musev:latest"
|
|
|
|
|
|
|
7 |
|
8 |
SHELL ["/bin/bash", "--login", "-c"]
|
9 |
|
10 |
+
# Set up a new user named "user" with user ID 1000
|
11 |
+
RUN useradd -m -u 1000 user
|
12 |
+
|
13 |
+
# Switch to the "user" user
|
14 |
+
USER user
|
15 |
+
|
16 |
+
# Set home to the user's home directory
|
17 |
+
ENV HOME=/home/user \
|
18 |
+
PATH=/home/user/.local/bin:$PATH
|
19 |
+
|
20 |
+
# Set the working directory to the user's home directory
|
21 |
+
WORKDIR $HOME/app
|
22 |
+
|
23 |
+
RUN echo "docker start"\
|
24 |
+
&& whoami \
|
25 |
+
&& which python \
|
26 |
+
&& pwd
|
27 |
+
|
28 |
+
RUN git clone -b hg_space --recursive https://github.com/TMElyralab/MuseV.git
|
29 |
+
# RUN mkdir ./MuseV/checkpoints \
|
30 |
+
# && ls -l ./MuseV
|
31 |
+
RUN chmod -R 777 /home/user/app/MuseV
|
32 |
+
|
33 |
+
# RUN git clone -b main https://huggingface.co/TMElyralab/MuseV /home/user/app/MuseV/checkpoints
|
34 |
+
|
35 |
RUN . /opt/conda/etc/profile.d/conda.sh \
|
36 |
&& echo "source activate musev" >> ~/.bashrc \
|
37 |
&& conda activate musev \
|
38 |
+
&& conda env list
|
39 |
+
|
40 |
+
RUN echo "export PYTHONPATH=\${PYTHONPATH}:/home/user/app/MuseV:/home/user/app/MuseV/MMCM:/home/user/app/MuseV/diffusers/src:/home/user/app/MuseV/controlnet_aux/src" >> ~/.bashrc
|
41 |
+
|
42 |
+
WORKDIR /home/user/app/MuseV/scripts/gradio/
|
43 |
+
|
44 |
+
# Add entrypoint script
|
45 |
+
COPY --chown=user entrypoint.sh ./entrypoint.sh
|
46 |
+
RUN chmod +x ./entrypoint.sh
|
47 |
+
RUN ls -l ./
|
48 |
+
|
49 |
+
EXPOSE 7860
|
50 |
+
|
51 |
+
# CMD ["/bin/bash", "-c", "python app.py"]
|
52 |
+
CMD ["./entrypoint.sh"]
|
scripts/gradio/entrypoint.sh
CHANGED
@@ -1,21 +1,16 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
-
echo "
|
4 |
whoami
|
5 |
|
6 |
-
# Print Python location
|
7 |
-
which python
|
8 |
-
echo "pythonpath :$PYTHONPATH"
|
9 |
-
|
10 |
# Activate conda environment
|
|
|
11 |
conda activate musev
|
12 |
|
13 |
-
# Print
|
14 |
-
which python
|
15 |
-
python --version
|
16 |
-
|
17 |
-
# Install any pending dependencies
|
18 |
-
pip install --no-cache-dir -U openmim
|
19 |
|
20 |
# Run the app
|
21 |
cd /home/user/app
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
echo "=== Starting MuseV Gradio App ==="
|
4 |
whoami
|
5 |
|
|
|
|
|
|
|
|
|
6 |
# Activate conda environment
|
7 |
+
source /opt/conda/etc/profile.d/conda.sh
|
8 |
conda activate musev
|
9 |
|
10 |
+
# Print environment info
|
11 |
+
echo "Python: $(which python)"
|
12 |
+
echo "Python version: $(python --version)"
|
13 |
+
echo "PYTHONPATH: $PYTHONPATH"
|
|
|
|
|
14 |
|
15 |
# Run the app
|
16 |
cd /home/user/app
|