jmanhype commited on
Commit
7c2f064
Β·
1 Parent(s): 667eb29

refactor: switch to NVIDIA CUDA base image and improve Dockerfile structure

Browse files
Files changed (1) hide show
  1. scripts/gradio/Dockerfile +18 -32
scripts/gradio/Dockerfile CHANGED
@@ -1,30 +1,26 @@
1
- FROM anchorxia/musev:latest
2
 
3
- #MAINTAINER η»΄ζŠ€θ€…δΏ‘ζ―
4
- LABEL MAINTAINER="anchorxia, zhanchao"
5
6
- LABEL Description="musev gradio image, from docker pull anchorxia/musev:latest"
7
 
8
- # Install required packages and set up git config
9
  USER root
10
- RUN apt-get update && \
11
- apt-get install -y wget curl && \
12
- rm -rf /var/lib/apt/lists/* && \
13
- rm -rf /etc/gitconfig && \
 
 
 
 
 
 
 
14
  touch /etc/gitconfig && \
15
  chmod 666 /etc/gitconfig && \
16
  git config --system user.email "[email protected]" && \
17
  git config --system user.name "jmanhype"
18
 
19
- # Download and install VSCode server
20
- RUN if [ ! -d "/opt/openvscode-server" ]; then \
21
- wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.86.2/openvscode-server-v1.86.2-linux-x64.tar.gz -O /tmp/openvscode-server.tar.gz && \
22
- tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
23
- rm /tmp/openvscode-server.tar.gz && \
24
- mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server && \
25
- chown -R 1000:1000 /opt/openvscode-server; \
26
- fi
27
-
28
  # Create necessary directories with proper permissions
29
  RUN mkdir -p /home/user/.config/matplotlib && \
30
  mkdir -p /home/user/app/flagged && \
@@ -33,8 +29,6 @@ RUN mkdir -p /home/user/.config/matplotlib && \
33
  chmod -R 777 /home/user/.config && \
34
  chmod -R 777 /home/user/app
35
 
36
- SHELL ["/bin/bash", "--login", "-c"]
37
-
38
  # Set up a new user named "user" with user ID 1000
39
  RUN useradd -m -u 1000 user
40
 
@@ -52,10 +46,9 @@ ENV HOME=/home/user \
52
  # Set the working directory to the user's home directory
53
  WORKDIR $HOME/app
54
 
55
- RUN echo "docker start"\
56
- && whoami \
57
- && which python \
58
- && pwd
59
 
60
  # Clone repository without git config
61
  RUN git clone -b hg_space --recursive https://github.com/TMElyralab/MuseV.git
@@ -63,13 +56,6 @@ RUN git clone -b hg_space --recursive https://github.com/TMElyralab/MuseV.git
63
  # Set permissions
64
  RUN chmod -R 777 /home/user/app/MuseV
65
 
66
- RUN . /opt/conda/etc/profile.d/conda.sh \
67
- && echo "source activate musev" >> ~/.bashrc \
68
- && conda activate musev \
69
- && conda env list
70
-
71
- 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
72
-
73
  WORKDIR /home/user/app/MuseV/scripts/gradio/
74
 
75
  # Add entrypoint script
 
1
+ FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV PYTHONUNBUFFERED=1
 
 
5
 
6
+ # Install system dependencies
7
  USER root
8
+ RUN apt-get update && apt-get install -y \
9
+ python3.10 \
10
+ python3-pip \
11
+ git \
12
+ wget \
13
+ curl \
14
+ ffmpeg \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Set up git config file
18
+ RUN rm -rf /etc/gitconfig && \
19
  touch /etc/gitconfig && \
20
  chmod 666 /etc/gitconfig && \
21
  git config --system user.email "[email protected]" && \
22
  git config --system user.name "jmanhype"
23
 
 
 
 
 
 
 
 
 
 
24
  # Create necessary directories with proper permissions
25
  RUN mkdir -p /home/user/.config/matplotlib && \
26
  mkdir -p /home/user/app/flagged && \
 
29
  chmod -R 777 /home/user/.config && \
30
  chmod -R 777 /home/user/app
31
 
 
 
32
  # Set up a new user named "user" with user ID 1000
33
  RUN useradd -m -u 1000 user
34
 
 
46
  # Set the working directory to the user's home directory
47
  WORKDIR $HOME/app
48
 
49
+ # Install Python dependencies
50
+ COPY --chown=user requirements.txt .
51
+ RUN pip install --no-cache-dir -r requirements.txt
 
52
 
53
  # Clone repository without git config
54
  RUN git clone -b hg_space --recursive https://github.com/TMElyralab/MuseV.git
 
56
  # Set permissions
57
  RUN chmod -R 777 /home/user/app/MuseV
58
 
 
 
 
 
 
 
 
59
  WORKDIR /home/user/app/MuseV/scripts/gradio/
60
 
61
  # Add entrypoint script