ecommeh commited on
Commit
533e17d
·
verified ·
1 Parent(s): 4caa18b

Update Dockerfile

Browse files

updated the dockerfile

Files changed (1) hide show
  1. Dockerfile +23 -67
Dockerfile CHANGED
@@ -1,89 +1,45 @@
1
  FROM anchorxia/musev:latest
2
 
3
- #MAINTAINER 维护者信息
4
  LABEL MAINTAINER="zkangchen"
5
  LABEL Email="zkangchen@tencent.com"
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
-
24
- ################################################# INSTALLING FFMPEG ##################################################
25
- # RUN apt-get update ; apt-get install -y git build-essential gcc make yasm autoconf automake cmake libtool checkinstall libmp3lame-dev pkg-config libunwind-dev zlib1g-dev libssl-dev
26
-
27
- # RUN apt-get update \
28
- # && apt-get clean \
29
- # && apt-get install -y --no-install-recommends libc6-dev libgdiplus wget software-properties-common
30
-
31
- #RUN RUN apt-add-repository ppa:git-core/ppa && apt-get update && apt-get install -y git
32
-
33
- # RUN wget https://www.ffmpeg.org/releases/ffmpeg-4.0.2.tar.gz
34
- # RUN tar -xzf ffmpeg-4.0.2.tar.gz; rm -r ffmpeg-4.0.2.tar.gz
35
- # RUN cd ./ffmpeg-4.0.2; ./configure --enable-gpl --enable-libmp3lame --enable-decoder=mjpeg,png --enable-encoder=png --enable-openssl --enable-nonfree
36
-
37
-
38
- # RUN cd ./ffmpeg-4.0.2; make
39
- # RUN cd ./ffmpeg-4.0.2; make install
40
- ######################################################################################################################
41
-
42
- RUN echo "docker start"\
43
- && whoami \
44
- && which python \
45
- && pwd
46
-
47
  RUN git clone -b main --recursive https://github.com/TMElyralab/MuseTalk.git
48
 
49
- RUN chmod -R 777 /home/user/app/MuseTalk
50
-
51
-
52
 
53
- RUN . /opt/conda/etc/profile.d/conda.sh \
54
- && echo "source activate musev" >> ~/.bashrc \
55
- && conda activate musev \
56
- && conda env list
57
- # && conda install ffmpeg
58
 
59
- RUN ffmpeg -codecs
 
 
 
 
 
 
 
 
 
60
 
 
 
61
 
 
62
 
63
-
64
-
65
- WORKDIR /home/user/app/MuseTalk/
66
-
67
- RUN pip install -r requirements.txt \
68
- && pip install --no-cache-dir -U openmim \
69
- && mim install mmengine \
70
- && mim install "mmcv>=2.0.1" \
71
- && mim install "mmdet>=3.1.0" \
72
- && mim install "mmpose>=1.1.0"
73
-
74
-
75
- # Add entrypoint script
76
- #RUN chmod 777 ./entrypoint.sh
77
- RUN ls -l ./
78
-
79
  EXPOSE 7860
80
 
81
- # CMD ["/bin/bash", "-c", "python app.py"]
82
- CMD ["./install_ffmpeg.sh"]
83
- CMD ["./entrypoint.sh"]
84
-
85
-
86
-
87
-
88
-
89
-
 
1
  FROM anchorxia/musev:latest
2
 
 
3
  LABEL MAINTAINER="zkangchen"
4
  LABEL Email="zkangchen@tencent.com"
5
+ LABEL Description="MuseTalk Gradio image for Hugging Face Spaces"
6
 
7
  SHELL ["/bin/bash", "--login", "-c"]
8
 
9
+ # Create a user and switch to it
10
  RUN useradd -m -u 1000 user
 
 
11
  USER user
 
 
12
  ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH
14
 
 
15
  WORKDIR $HOME/app
16
 
17
+ # Clone MuseTalk repo
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  RUN git clone -b main --recursive https://github.com/TMElyralab/MuseTalk.git
19
 
20
+ # Set working directory to MuseTalk project
21
+ WORKDIR $HOME/app/MuseTalk
 
22
 
23
+ # Make all files executable
24
+ RUN chmod -R 777 .
 
 
 
25
 
26
+ # Activate conda env and install dependencies
27
+ RUN . /opt/conda/etc/profile.d/conda.sh && \
28
+ echo "source activate musev" >> ~/.bashrc && \
29
+ conda activate musev && \
30
+ pip install -r requirements.txt && \
31
+ pip install --no-cache-dir -U openmim && \
32
+ mim install mmengine && \
33
+ mim install "mmcv>=2.0.1" && \
34
+ mim install "mmdet>=3.1.0" && \
35
+ mim install "mmpose>=1.1.0"
36
 
37
+ # Optional: Check ffmpeg availability
38
+ RUN ffmpeg -codecs || echo "FFmpeg check failed or not installed"
39
 
40
+ RUN chmod +x download_weights.sh && ./download_weights.sh
41
 
42
+ # Expose port for Gradio
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  EXPOSE 7860
44
 
45
+ CMD ["bash", "-c", "./install_ffmpeg.sh && ./entrypoint.sh"]