Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +30 -67
Dockerfile
CHANGED
@@ -1,10 +1,5 @@
|
|
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
|
8 |
RUN rm -f /etc/apt/sources.list.d/*.list && \
|
9 |
apt-get update && apt-get install -y --no-install-recommends \
|
10 |
curl \
|
@@ -24,82 +19,50 @@ RUN rm -f /etc/apt/sources.list.d/*.list && \
|
|
24 |
build-essential \
|
25 |
libsndfile-dev \
|
26 |
software-properties-common \
|
27 |
-
|
28 |
|
29 |
-
RUN
|
30 |
-
apt-get upgrade -y && \
|
31 |
-
apt-get install -y --no-install-recommends nvtop
|
32 |
|
33 |
-
RUN
|
34 |
-
apt-get install -y nodejs && \
|
35 |
-
npm install -g configurable-http-proxy
|
36 |
|
37 |
-
# Create a working directory
|
38 |
WORKDIR /app
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
&& chmod -R 777 $HOME
|
50 |
-
|
51 |
-
# Set up the Conda environment
|
52 |
-
ENV CONDA_AUTO_UPDATE_CONDA=false \
|
53 |
-
PATH=$HOME/miniconda/bin:$PATH
|
54 |
-
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
|
55 |
-
&& chmod +x ~/miniconda.sh \
|
56 |
-
&& ~/miniconda.sh -b -p ~/miniconda \
|
57 |
-
&& rm ~/miniconda.sh \
|
58 |
-
&& conda clean -ya
|
59 |
|
60 |
-
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
#######################################
|
65 |
|
66 |
-
|
67 |
|
68 |
-
# User Debian packages
|
69 |
-
## Security warning : Potential user code executed as root (build time)
|
70 |
RUN --mount=target=/root/packages.txt,source=packages.txt \
|
71 |
apt-get update && \
|
72 |
-
xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
|
73 |
-
|
74 |
-
|
75 |
-
RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
|
76 |
-
bash /root/on_startup.sh
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
#######################################
|
83 |
-
|
84 |
-
USER user
|
85 |
-
|
86 |
-
# Python packages
|
87 |
-
RUN --mount=target=requirements.txt,source=requirements.txt \
|
88 |
-
pip install --no-cache-dir --upgrade -r requirements.txt
|
89 |
-
|
90 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
91 |
-
COPY --chown=user . $HOME/app
|
92 |
|
93 |
-
RUN
|
|
|
|
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
GRADIO_NUM_PORTS=1 \
|
100 |
-
GRADIO_SERVER_NAME=0.0.0.0 \
|
101 |
-
GRADIO_THEME=huggingface \
|
102 |
-
SYSTEM=spaces \
|
103 |
-
SHELL=/bin/bash
|
104 |
|
105 |
-
CMD ["
|
|
|
1 |
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
RUN rm -f /etc/apt/sources.list.d/*.list && \
|
4 |
apt-get update && apt-get install -y --no-install-recommends \
|
5 |
curl \
|
|
|
19 |
build-essential \
|
20 |
libsndfile-dev \
|
21 |
software-properties-common \
|
22 |
+
&& rm -rf /var/lib/apt/lists/*
|
23 |
|
24 |
+
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
|
|
|
|
25 |
|
26 |
+
RUN mkdir /home/user/.cache /home/user/.config && chmod -R 777 /home/user
|
|
|
|
|
27 |
|
|
|
28 |
WORKDIR /app
|
29 |
|
30 |
+
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh && \
|
31 |
+
chmod +x ~/miniconda.sh && \
|
32 |
+
~/miniconda.sh -b -p ~/miniconda && \
|
33 |
+
rm ~/miniconda.sh && \
|
34 |
+
conda clean -ya
|
35 |
|
36 |
+
RUN add-apt-repository ppa:flexiondotorg/nvtop && \
|
37 |
+
apt-get upgrade -y && \
|
38 |
+
apt-get install -y --no-install-recommends nvtop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
+
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
|
41 |
+
apt-get install -y nodejs && \
|
42 |
+
npm install -g configurable-http-proxy
|
43 |
|
44 |
+
RUN adduser --disabled-password --gecos '' --shell /bin/bash user && \
|
45 |
+
chown -R user:user /app
|
|
|
46 |
|
47 |
+
WORKDIR /home/user/app
|
48 |
|
|
|
|
|
49 |
RUN --mount=target=/root/packages.txt,source=packages.txt \
|
50 |
apt-get update && \
|
51 |
+
xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends && \
|
52 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
53 |
|
54 |
+
# Adding the deadsnakes PPA and installing Python 3.10
|
55 |
+
RUN add-apt-repository ppa:deadsnakes/ppa && \
|
56 |
+
apt-get update && \
|
57 |
+
apt-get install -y python3.10 python3.10-venv python3.10-dev python3.10-distutils
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
RUN curl -sL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
|
60 |
+
python3.10 get-pip.py && \
|
61 |
+
rm get-pip.py
|
62 |
|
63 |
+
RUN ln -s /usr/bin/python3.10 /usr/local/bin/python3
|
64 |
|
65 |
+
COPY . /home/user/app
|
66 |
+
RUN pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
+
CMD ["bash", "/root/on_startup.sh"]
|