thejagstudio commited on
Commit
cce7ffb
·
verified ·
1 Parent(s): aba5c38

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +111 -111
Dockerfile CHANGED
@@ -1,111 +1,111 @@
1
- FROM nvidia/cuda:11.3.1-base-ubuntu20.04
2
-
3
- ENV DEBIAN_FRONTEND=noninteractive \
4
- TZ=Europe/Paris
5
- EXPOSE 9876
6
- EXPOSE 8765
7
- EXPOSE 7654
8
- EXPOSE 6543
9
- EXPOSE 5432
10
- EXPOSE 4321
11
- EXPOSE 3210
12
- # Remove any third-party apt sources to avoid issues with expiring keys.
13
- # Install some basic utilities
14
- RUN rm -f /etc/apt/sources.list.d/*.list && \
15
- apt-get update && apt-get install -y --no-install-recommends \
16
- curl \
17
- ca-certificates \
18
- sudo \
19
- git \
20
- wget \
21
- procps \
22
- git-lfs \
23
- zip \
24
- unzip \
25
- htop \
26
- vim \
27
- nano \
28
- bzip2 \
29
- libx11-6 \
30
- build-essential \
31
- libsndfile-dev \
32
- software-properties-common \
33
- && rm -rf /var/lib/apt/lists/*
34
-
35
- RUN add-apt-repository ppa:flexiondotorg/nvtop && \
36
- apt-get upgrade -y && \
37
- apt-get install -y --no-install-recommends nvtop
38
-
39
- RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
40
- apt-get install -y nodejs && \
41
- npm install -g configurable-http-proxy
42
-
43
- # Create a working directory
44
- WORKDIR /app
45
-
46
- # Create a non-root user and switch to it
47
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
48
- && chown -R user:user /app
49
- RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
50
- USER user
51
-
52
- # All users can use /home/user as their home directory
53
- ENV HOME=/home/user
54
- RUN mkdir $HOME/.cache $HOME/.config \
55
- && chmod -R 777 $HOME
56
-
57
- # Set up the Conda environment
58
- ENV CONDA_AUTO_UPDATE_CONDA=false \
59
- PATH=$HOME/miniconda/bin:$PATH
60
- RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
61
- && chmod +x ~/miniconda.sh \
62
- && ~/miniconda.sh -b -p ~/miniconda \
63
- && rm ~/miniconda.sh \
64
- && conda clean -ya
65
-
66
- WORKDIR $HOME/app
67
-
68
- #######################################
69
- # Start root user section
70
- #######################################
71
-
72
- USER root
73
-
74
- # User Debian packages
75
- ## Security warning : Potential user code executed as root (build time)
76
- RUN --mount=target=/root/packages.txt,source=packages.txt \
77
- apt-get update && \
78
- xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
79
- && rm -rf /var/lib/apt/lists/*
80
-
81
- RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
82
- bash /root/on_startup.sh
83
-
84
- RUN mkdir /data && chown user:user /data
85
-
86
- #######################################
87
- # End root user section
88
- #######################################
89
-
90
- USER user
91
-
92
- # Python packages
93
- RUN --mount=target=requirements.txt,source=requirements.txt \
94
- pip install --no-cache-dir --upgrade -r requirements.txt
95
-
96
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
97
- COPY --chown=user . $HOME/app
98
-
99
- RUN chmod +x start_server.sh
100
-
101
- COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
102
-
103
- ENV PYTHONUNBUFFERED=1 \
104
- GRADIO_ALLOW_FLAGGING=never \
105
- GRADIO_NUM_PORTS=1 \
106
- GRADIO_SERVER_NAME=0.0.0.0 \
107
- GRADIO_THEME=huggingface \
108
- SYSTEM=spaces \
109
- SHELL=/bin/bash
110
-
111
- CMD ["./start_server.sh"]
 
1
+ FROM nvidia/cuda:11.3.1-base-ubuntu20.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ TZ=Europe/Paris
5
+ EXPOSE 9876
6
+ EXPOSE 8765
7
+ EXPOSE 7654
8
+ EXPOSE 6543
9
+ EXPOSE 5432
10
+ EXPOSE 4321
11
+ EXPOSE 3210
12
+ # Remove any third-party apt sources to avoid issues with expiring keys.
13
+ # Install some basic utilities
14
+ RUN rm -f /etc/apt/sources.list.d/*.list && \
15
+ apt-get update && apt-get install -y --no-install-recommends \
16
+ curl \
17
+ ca-certificates \
18
+ sudo \
19
+ git \
20
+ wget \
21
+ procps \
22
+ git-lfs \
23
+ zip \
24
+ unzip \
25
+ htop \
26
+ vim \
27
+ nano \
28
+ bzip2 \
29
+ libx11-6 \
30
+ build-essential \
31
+ libsndfile-dev \
32
+ software-properties-common \
33
+ && rm -rf /var/lib/apt/lists/*
34
+
35
+ RUN add-apt-repository ppa:flexiondotorg/nvtop && \
36
+ apt-get upgrade -y && \
37
+ apt-get install -y --no-install-recommends nvtop
38
+
39
+ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
40
+ apt-get install -y nodejs && \
41
+ npm install -g configurable-http-proxy
42
+
43
+ # Create a working directory
44
+ WORKDIR /app
45
+
46
+ # Create a non-root user and switch to it
47
+ RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
48
+ && chown -R user:user /app
49
+ RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
50
+ USER user
51
+
52
+ # All users can use /home/user as their home directory
53
+ ENV HOME=/home/user
54
+ RUN mkdir $HOME/.cache $HOME/.config \
55
+ && chmod -R 777 $HOME
56
+
57
+ # Set up the Conda environment
58
+ ENV CONDA_AUTO_UPDATE_CONDA=false \
59
+ PATH=$HOME/miniconda/bin:$PATH
60
+ RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
61
+ && chmod +x ~/miniconda.sh \
62
+ && ~/miniconda.sh -b -p ~/miniconda \
63
+ && rm ~/miniconda.sh \
64
+ && conda clean -ya
65
+
66
+ WORKDIR $HOME/app
67
+
68
+ #######################################
69
+ # Start root user section
70
+ #######################################
71
+
72
+ USER root
73
+
74
+ # User Debian packages
75
+ ## Security warning : Potential user code executed as root (build time)
76
+ RUN --mount=target=/root/packages.txt,source=packages.txt \
77
+ apt-get update && \
78
+ xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
79
+ && rm -rf /var/lib/apt/lists/*
80
+
81
+ RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
82
+ bash /root/on_startup.sh
83
+
84
+ RUN mkdir /data && chown user:user /data
85
+
86
+ #######################################
87
+ # End root user section
88
+ #######################################
89
+
90
+ USER user
91
+
92
+ # Python packages
93
+ RUN --mount=target=requirements.txt,source=requirements.txt \
94
+ pip install --no-cache-dir --upgrade -r requirements.txt
95
+
96
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
97
+ COPY --chown=user . $HOME/app
98
+
99
+ RUN chmod +x start_server.sh
100
+
101
+ COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
102
+
103
+ ENV PYTHONUNBUFFERED=1 \
104
+ GRADIO_ALLOW_FLAGGING=never \
105
+ GRADIO_NUM_PORTS=1 \
106
+ GRADIO_SERVER_NAME=0.0.0.0 \
107
+ GRADIO_THEME=huggingface \
108
+ SYSTEM=spaces \
109
+ SHELL=/bin/bash
110
+
111
+ CMD ["/home/user/app/start_server.sh"]