Vivian Liu commited on
Commit
7f6e42c
·
1 Parent(s): 5303d77

Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -29
Dockerfile CHANGED
@@ -1,42 +1,61 @@
1
  FROM nvidia/cuda:12.2.0-base-ubuntu22.04
2
- ENV DEBIAN_FRONTEND noninteractive
3
-
4
- RUN apt-get update -y && apt-get upgrade -y \
5
- && apt-get install -y libgl1 libgl1-mesa-glx libglib2.0-0 wget git git-lfs python3-pip python-is-python3 snapd curl ca-certificates sudo zip unzip htop bzip2 libx11-6 build-essential libsndfile-dev software-properties-common \
6
-
7
 
8
- RUN sudo add-apt-repository ppa:savoury1/ffmpeg4 && apt-get update -y && apt-get install -y ffmpeg
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  RUN pip3 install --upgrade pip
11
 
12
- RUN git clone https://github.com/hellovivian/generative-disco.git && cd generative-disco && pip install --ignore-installed stable_diffusion_videos
 
 
 
13
 
14
- RUN adduser --disabled-password --gecos '' user && adduser user sudo
15
- #RUN mkdir /content && chown -R user:user /content
16
- #WORKDIR /content
17
- RUN chown -R user:user /generative-disco/static/
18
 
 
19
  USER user
20
- CMD /bin/bash
21
-
22
- RUN echo ffmpeg -version
23
-
24
- #RUN echo $PATH
25
- #RUN export PATH="$HOME/user/.local/bin:$PATH"; echo $PATH
26
- #RUN echo $PATH
27
-
28
- #RUN pip install numba youtube-dl librosa flask openai moviepy Pillow accelerate \
29
- # && mkdir ./.cache
30
 
 
 
 
31
 
 
32
  EXPOSE 7860
33
- WORKDIR generative-disco
34
- COPY . ./generative-disco
35
-
36
-
37
- CMD [ "python", "../generative-disco/stable_diffusion_videos/app.py"]
38
-
39
-
40
- #CMD ["python", "../generative-disco/flask_app.py", "--port", "7860", "--host", "0.0.0.0"]
41
 
 
 
42
 
 
1
  FROM nvidia/cuda:12.2.0-base-ubuntu22.04
 
 
 
 
 
2
 
3
+ ENV DEBIAN_FRONTEND noninteractive
4
 
5
+ # Update and install necessary packages
6
+ RUN apt-get update -y && apt-get upgrade -y \
7
+ && apt-get install -y \
8
+ libgl1 \
9
+ libgl1-mesa-glx \
10
+ libglib2.0-0 \
11
+ wget \
12
+ git \
13
+ git-lfs \
14
+ python3-pip \
15
+ python-is-python3 \
16
+ snapd \
17
+ curl \
18
+ ca-certificates \
19
+ sudo \
20
+ zip \
21
+ unzip \
22
+ htop \
23
+ bzip2 \
24
+ libx11-6 \
25
+ build-essential \
26
+ libsndfile-dev \
27
+ software-properties-common \
28
+ && apt-get clean
29
+
30
+ # Add FFmpeg PPA and install FFmpeg
31
+ RUN add-apt-repository ppa:savoury1/ffmpeg4 -y \
32
+ && apt-get update -y \
33
+ && apt-get install -y ffmpeg \
34
+ && apt-get clean
35
+
36
+ # Upgrade pip
37
  RUN pip3 install --upgrade pip
38
 
39
+ # Clone the repository and install Python dependencies
40
+ RUN git clone https://github.com/hellovivian/generative-disco.git \
41
+ && cd generative-disco \
42
+ && pip install --ignore-installed stable_diffusion_videos
43
 
44
+ # Add user and give permissions
45
+ RUN adduser --disabled-password --gecos '' user \
46
+ && adduser user sudo \
47
+ && chown -R user:user /generative-disco/static/
48
 
49
+ # Switch to the new user
50
  USER user
 
 
 
 
 
 
 
 
 
 
51
 
52
+ # Set working directory and copy contents
53
+ WORKDIR /generative-disco
54
+ COPY . .
55
 
56
+ # Expose the port
57
  EXPOSE 7860
 
 
 
 
 
 
 
 
58
 
59
+ # Run the application
60
+ CMD ["python", "flask_app.py"]
61