Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +19 -14
Dockerfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
4 |
-
|
5 |
|
6 |
# Remove any third-party apt sources to avoid issues with expiring keys.
|
7 |
# Install some basic utilities
|
@@ -26,7 +26,7 @@ RUN add-apt-repository ppa:flexiondotorg/nvtop && \
|
|
26 |
apt-get upgrade -y && \
|
27 |
apt-get install -y --no-install-recommends nvtop
|
28 |
|
29 |
-
RUN curl -sL https://deb.nodesource.com/setup_14.x
|
30 |
apt-get install -y nodejs && \
|
31 |
npm install -g configurable-http-proxy
|
32 |
|
@@ -39,17 +39,22 @@ RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
|
39 |
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
40 |
USER user
|
41 |
|
42 |
-
#
|
43 |
-
ENV HOME=/
|
44 |
-
RUN mkdir $HOME/.cache $HOME/.config \
|
45 |
&& chmod -R 777 $HOME
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
# Set up the Conda environment
|
48 |
ENV CONDA_AUTO_UPDATE_CONDA=false \
|
49 |
PATH=$HOME/miniconda/bin:$PATH
|
50 |
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
|
51 |
&& chmod +x ~/miniconda.sh \
|
52 |
-
&& ~/miniconda.sh -b -p
|
53 |
&& rm ~/miniconda.sh \
|
54 |
&& conda clean -ya
|
55 |
|
@@ -62,14 +67,14 @@ WORKDIR $HOME/app
|
|
62 |
USER root
|
63 |
|
64 |
# User Debian packages
|
65 |
-
## Security warning
|
66 |
RUN --mount=target=/root/packages.txt,source=packages.txt \
|
67 |
apt-get update && \
|
68 |
xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
|
69 |
&& rm -rf /var/lib/apt/lists/*
|
70 |
|
71 |
RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
|
72 |
-
|
73 |
|
74 |
#######################################
|
75 |
# End root user section
|
@@ -89,11 +94,11 @@ RUN chmod +x start_server.sh
|
|
89 |
COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
90 |
|
91 |
ENV PYTHONUNBUFFERED=1 \
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
|
99 |
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 |
|
6 |
# Remove any third-party apt sources to avoid issues with expiring keys.
|
7 |
# Install some basic utilities
|
|
|
26 |
apt-get upgrade -y && \
|
27 |
apt-get install -y --no-install-recommends nvtop
|
28 |
|
29 |
+
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
|
30 |
apt-get install -y nodejs && \
|
31 |
npm install -g configurable-http-proxy
|
32 |
|
|
|
39 |
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
40 |
USER user
|
41 |
|
42 |
+
# Change HOME to /data
|
43 |
+
ENV HOME=/data
|
44 |
+
RUN mkdir -p $HOME/.cache $HOME/.config \
|
45 |
&& chmod -R 777 $HOME
|
46 |
|
47 |
+
# Ensure /data directory exists and is accessible
|
48 |
+
USER root
|
49 |
+
RUN mkdir -p /data && chown -R user:user /data
|
50 |
+
USER user
|
51 |
+
|
52 |
# Set up the Conda environment
|
53 |
ENV CONDA_AUTO_UPDATE_CONDA=false \
|
54 |
PATH=$HOME/miniconda/bin:$PATH
|
55 |
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
|
56 |
&& chmod +x ~/miniconda.sh \
|
57 |
+
&& ~/miniconda.sh -b -p $HOME/miniconda \
|
58 |
&& rm ~/miniconda.sh \
|
59 |
&& conda clean -ya
|
60 |
|
|
|
67 |
USER root
|
68 |
|
69 |
# User Debian packages
|
70 |
+
## Security warning: Potential user code executed as root (build time)
|
71 |
RUN --mount=target=/root/packages.txt,source=packages.txt \
|
72 |
apt-get update && \
|
73 |
xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
|
74 |
&& rm -rf /var/lib/apt/lists/*
|
75 |
|
76 |
RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
|
77 |
+
bash /root/on_startup.sh
|
78 |
|
79 |
#######################################
|
80 |
# End root user section
|
|
|
94 |
COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
95 |
|
96 |
ENV PYTHONUNBUFFERED=1 \
|
97 |
+
GRADIO_ALLOW_FLAGGING=never \
|
98 |
+
GRADIO_NUM_PORTS=1 \
|
99 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
100 |
+
GRADIO_THEME=huggingface \
|
101 |
+
SYSTEM=spaces \
|
102 |
+
SHELL=/bin/bash
|
103 |
|
104 |
CMD ["./start_server.sh"]
|