Spaces:
Runtime error
Runtime error
node updated to v18LTS, gitignore added, rclone fix
Browse files- Dockerfile +24 -53
- start_server.sh +1 -1
Dockerfile
CHANGED
@@ -1,75 +1,46 @@
|
|
|
|
1 |
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Paris
|
4 |
|
5 |
-
#
|
6 |
-
# Install some basic utilities
|
7 |
RUN rm -f /etc/apt/sources.list.d/*.list && \
|
8 |
apt-get update && apt-get install -y --no-install-recommends \
|
9 |
-
curl \
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
zip \
|
15 |
-
unzip \
|
16 |
-
htop \
|
17 |
-
bzip2 \
|
18 |
-
libx11-6 \
|
19 |
-
build-essential \
|
20 |
-
libsndfile-dev \
|
21 |
-
software-properties-common \
|
22 |
-
openssh-server \
|
23 |
-
fuse \
|
24 |
-
&& rm -rf /var/lib/apt/lists/*
|
25 |
-
|
26 |
-
# Install rclone
|
27 |
-
RUN curl https://rclone.org/install.sh | bash
|
28 |
-
|
29 |
-
RUN add-apt-repository ppa:flexiondotorg/nvtop && \
|
30 |
apt-get upgrade -y && \
|
31 |
-
apt-get install -y --no-install-recommends nvtop
|
32 |
-
|
33 |
-
# Install Node.js 18 LTS
|
34 |
-
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
|
35 |
apt-get install -y nodejs && \
|
36 |
-
npm install -g configurable-http-proxy
|
|
|
37 |
|
38 |
-
#
|
39 |
-
ENV CONDA_AUTO_UPDATE_CONDA=false
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
&& ~/miniconda.sh -b -p /root/miniconda \
|
44 |
-
&& rm ~/miniconda.sh \
|
45 |
-
&& conda clean -ya
|
46 |
|
47 |
WORKDIR /root/app
|
48 |
|
49 |
-
# Python
|
50 |
RUN --mount=target=requirements.txt,source=requirements.txt \
|
51 |
pip install --no-cache-dir --upgrade -r requirements.txt
|
52 |
|
53 |
-
#
|
54 |
COPY . /root/app
|
55 |
-
|
56 |
-
# Copy rclone configuration
|
57 |
-
COPY rclone.conf /root/.config/rclone/rclone.conf
|
58 |
-
|
59 |
-
RUN chmod +x start_server.sh
|
60 |
-
|
61 |
COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
62 |
|
63 |
-
#
|
64 |
RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
|
65 |
-
echo '{ "theme": "JupyterLab Dark" }' > /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
|
|
|
66 |
|
67 |
-
ENV PYTHONUNBUFFERED=1 \
|
68 |
-
|
69 |
-
GRADIO_NUM_PORTS=1 \
|
70 |
-
GRADIO_SERVER_NAME=0.0.0.0 \
|
71 |
-
GRADIO_THEME=huggingface \
|
72 |
-
SYSTEM=spaces \
|
73 |
-
SHELL=/bin/bash
|
74 |
|
75 |
CMD ["./start_server.sh"]
|
|
|
1 |
+
# Utilizar una imagen base más ligera si es posible
|
2 |
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
|
3 |
|
4 |
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Paris
|
5 |
|
6 |
+
# Agrupar instalaciones de paquetes y minimizar capas
|
|
|
7 |
RUN rm -f /etc/apt/sources.list.d/*.list && \
|
8 |
apt-get update && apt-get install -y --no-install-recommends \
|
9 |
+
curl ca-certificates sudo git git-lfs zip unzip htop bzip2 \
|
10 |
+
libx11-6 build-essential libsndfile-dev software-properties-common \
|
11 |
+
openssh-server fuse && \
|
12 |
+
curl https://rclone.org/install.sh | bash && \
|
13 |
+
add-apt-repository ppa:flexiondotorg/nvtop && \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
apt-get upgrade -y && \
|
15 |
+
apt-get install -y --no-install-recommends nvtop && \
|
16 |
+
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
|
|
|
|
|
17 |
apt-get install -y nodejs && \
|
18 |
+
npm install -g configurable-http-proxy && \
|
19 |
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
20 |
|
21 |
+
# Configurar conda
|
22 |
+
ENV CONDA_AUTO_UPDATE_CONDA=false PATH=/root/miniconda/bin:$PATH
|
23 |
+
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh && \
|
24 |
+
chmod +x ~/miniconda.sh && ~/miniconda.sh -b -p /root/miniconda && \
|
25 |
+
rm ~/miniconda.sh && conda clean -ya
|
|
|
|
|
|
|
26 |
|
27 |
WORKDIR /root/app
|
28 |
|
29 |
+
# Instalar dependencias de Python en una sola capa
|
30 |
RUN --mount=target=requirements.txt,source=requirements.txt \
|
31 |
pip install --no-cache-dir --upgrade -r requirements.txt
|
32 |
|
33 |
+
# Copiar archivos necesarios y configuraciones
|
34 |
COPY . /root/app
|
35 |
+
#COPY rclone.conf /root/.config/rclone/rclone.conf
|
|
|
|
|
|
|
|
|
|
|
36 |
COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
37 |
|
38 |
+
# Configurar tema oscuro de JupyterLab
|
39 |
RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
|
40 |
+
echo '{ "theme": "JupyterLab Dark" }' > /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings && \
|
41 |
+
chmod +x start_server.sh
|
42 |
|
43 |
+
ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 \
|
44 |
+
GRADIO_SERVER_NAME=0.0.0.0 GRADIO_THEME=huggingface SYSTEM=spaces SHELL=/bin/bash
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
CMD ["./start_server.sh"]
|
start_server.sh
CHANGED
@@ -6,7 +6,7 @@ echo "Starting Jupyter Lab with token $JUPYTER_TOKEN"
|
|
6 |
NOTEBOOK_DIR="/data"
|
7 |
|
8 |
# Mount Google Drive
|
9 |
-
rclone mount gdrive: /root/GoogleDrive --daemon
|
10 |
|
11 |
jupyter-lab \
|
12 |
--ip 0.0.0.0 \
|
|
|
6 |
NOTEBOOK_DIR="/data"
|
7 |
|
8 |
# Mount Google Drive
|
9 |
+
#rclone mount gdrive: /root/GoogleDrive --daemon
|
10 |
|
11 |
jupyter-lab \
|
12 |
--ip 0.0.0.0 \
|