Spaces:
Runtime error
Runtime error
node updated to v18LTS, gitignore added, rclone fix
Browse files- Dockerfile +12 -12
- start_server.sh +6 -1
Dockerfile
CHANGED
@@ -1,8 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Paris
|
4 |
|
5 |
-
# Remove any third-party apt sources to avoid issues with expiring keys.
|
6 |
RUN rm -f /etc/apt/sources.list.d/*.list && \
|
7 |
apt-get update && apt-get install -y --no-install-recommends \
|
8 |
curl \
|
@@ -22,19 +28,16 @@ RUN rm -f /etc/apt/sources.list.d/*.list && \
|
|
22 |
fuse \
|
23 |
&& rm -rf /var/lib/apt/lists/*
|
24 |
|
25 |
-
# Install rclone
|
26 |
RUN curl https://rclone.org/install.sh | bash
|
27 |
|
28 |
RUN add-apt-repository ppa:flexiondotorg/nvtop && \
|
29 |
apt-get upgrade -y && \
|
30 |
apt-get install -y --no-install-recommends nvtop
|
31 |
|
32 |
-
# Install Node.js 18 LTS
|
33 |
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
|
34 |
apt-get install -y nodejs && \
|
35 |
npm install -g configurable-http-proxy
|
36 |
|
37 |
-
# Set up the Conda environment
|
38 |
ENV CONDA_AUTO_UPDATE_CONDA=false \
|
39 |
PATH=/root/miniconda/bin:$PATH
|
40 |
RUN curl -sLo /root/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
|
@@ -45,25 +48,20 @@ RUN curl -sLo /root/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-
|
|
45 |
|
46 |
WORKDIR /root/app
|
47 |
|
48 |
-
# Python packages
|
49 |
COPY requirements.txt .
|
50 |
RUN /root/miniconda/bin/pip install --no-cache-dir --upgrade -r requirements.txt
|
51 |
|
52 |
-
# Create a user and give sudo privileges
|
53 |
RUN useradd -m -s /bin/bash user && echo 'user:user' | chpasswd && adduser user sudo
|
|
|
54 |
|
55 |
-
# Copy the current directory contents into the container at /root/app
|
56 |
COPY . /root/app
|
57 |
|
58 |
-
# Copy rclone configuration
|
59 |
COPY rclone.conf /home/user/.config/rclone/rclone.conf
|
60 |
RUN chown -R user:user /home/user/.config
|
61 |
-
|
62 |
-
RUN chmod +x start_server.sh
|
63 |
|
64 |
COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
65 |
|
66 |
-
# Set dark theme for JupyterLab
|
67 |
USER user
|
68 |
RUN mkdir -p /home/user/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
|
69 |
echo '{ "theme": "JupyterLab Dark" }' > /home/user/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
|
@@ -76,4 +74,6 @@ ENV PYTHONUNBUFFERED=1 \
|
|
76 |
SYSTEM=spaces \
|
77 |
SHELL=/bin/bash
|
78 |
|
79 |
-
|
|
|
|
|
|
1 |
+
# Versi贸n 1.1
|
2 |
+
# dockerfile-v1.1
|
3 |
+
# Changelog:
|
4 |
+
# - A帽adido usuario 'user' con permisos de sudo.
|
5 |
+
# - Ajustados permisos para start_server.sh.
|
6 |
+
# - A帽adido chmod 4755 para sudo.
|
7 |
+
|
8 |
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
|
9 |
|
10 |
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Paris
|
11 |
|
|
|
12 |
RUN rm -f /etc/apt/sources.list.d/*.list && \
|
13 |
apt-get update && apt-get install -y --no-install-recommends \
|
14 |
curl \
|
|
|
28 |
fuse \
|
29 |
&& rm -rf /var/lib/apt/lists/*
|
30 |
|
|
|
31 |
RUN curl https://rclone.org/install.sh | bash
|
32 |
|
33 |
RUN add-apt-repository ppa:flexiondotorg/nvtop && \
|
34 |
apt-get upgrade -y && \
|
35 |
apt-get install -y --no-install-recommends nvtop
|
36 |
|
|
|
37 |
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
|
38 |
apt-get install -y nodejs && \
|
39 |
npm install -g configurable-http-proxy
|
40 |
|
|
|
41 |
ENV CONDA_AUTO_UPDATE_CONDA=false \
|
42 |
PATH=/root/miniconda/bin:$PATH
|
43 |
RUN curl -sLo /root/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
|
|
|
48 |
|
49 |
WORKDIR /root/app
|
50 |
|
|
|
51 |
COPY requirements.txt .
|
52 |
RUN /root/miniconda/bin/pip install --no-cache-dir --upgrade -r requirements.txt
|
53 |
|
|
|
54 |
RUN useradd -m -s /bin/bash user && echo 'user:user' | chpasswd && adduser user sudo
|
55 |
+
RUN chmod 4755 /usr/bin/sudo
|
56 |
|
|
|
57 |
COPY . /root/app
|
58 |
|
|
|
59 |
COPY rclone.conf /home/user/.config/rclone/rclone.conf
|
60 |
RUN chown -R user:user /home/user/.config
|
61 |
+
RUN chmod +x /root/app/start_server.sh
|
|
|
62 |
|
63 |
COPY login.html /root/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
|
64 |
|
|
|
65 |
USER user
|
66 |
RUN mkdir -p /home/user/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \
|
67 |
echo '{ "theme": "JupyterLab Dark" }' > /home/user/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings
|
|
|
74 |
SYSTEM=spaces \
|
75 |
SHELL=/bin/bash
|
76 |
|
77 |
+
USER root
|
78 |
+
|
79 |
+
CMD ["/root/app/start_server.sh"]
|
start_server.sh
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
echo "Starting Jupyter Lab with token [REDACTED]"
|
@@ -7,7 +12,7 @@ NOTEBOOK_DIR="/root/app/data"
|
|
7 |
# Mount Google Drive
|
8 |
rclone mount gdrive: /home/user/GoogleDrive --daemon
|
9 |
|
10 |
-
jupyter-lab \
|
11 |
--ip 0.0.0.0 \
|
12 |
--port 7860 \
|
13 |
--no-browser \
|
|
|
1 |
+
# Versi贸n 1.1
|
2 |
+
# start_server.sh-v1.1
|
3 |
+
# Changelog:
|
4 |
+
# - Asegurado que el script tenga permisos ejecutables.
|
5 |
+
|
6 |
#!/bin/bash
|
7 |
|
8 |
echo "Starting Jupyter Lab with token [REDACTED]"
|
|
|
12 |
# Mount Google Drive
|
13 |
rclone mount gdrive: /home/user/GoogleDrive --daemon
|
14 |
|
15 |
+
/root/miniconda/bin/jupyter-lab \
|
16 |
--ip 0.0.0.0 \
|
17 |
--port 7860 \
|
18 |
--no-browser \
|