atonyxu
commited on
Commit
·
01781b6
1
Parent(s):
f593442
code
Browse files- Dockerfile +1 -5
- start_server.sh +10 -3
Dockerfile
CHANGED
@@ -106,9 +106,5 @@ ENV PYTHONUNBUFFERED=1 \
|
|
106 |
SHELL=/bin/bash
|
107 |
|
108 |
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
109 |
-
|
110 |
-
RUN echo password: ${JUPYTER_TOKEN:=huggingface}
|
111 |
-
RUN sleep 30s
|
112 |
-
RUN cat /data/start.log
|
113 |
-
RUN cat /home/user/.config/code-server/config.yaml
|
114 |
WORKDIR /data
|
|
|
106 |
SHELL=/bin/bash
|
107 |
|
108 |
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
109 |
+
CMD ["/home/user/app/start_server.sh"]
|
|
|
|
|
|
|
|
|
110 |
WORKDIR /data
|
start_server.sh
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
#!/bin/bash
|
2 |
JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
|
|
|
|
|
|
|
3 |
|
4 |
NOTEBOOK_DIR="/data"
|
5 |
|
6 |
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
|
7 |
|
8 |
-
jupyter-lab \
|
9 |
--ip 0.0.0.0 \
|
10 |
-
--port
|
11 |
--no-browser \
|
12 |
--allow-root \
|
13 |
--ServerApp.token="$JUPYTER_TOKEN" \
|
@@ -16,4 +19,8 @@ jupyter-lab \
|
|
16 |
--ServerApp.disable_check_xsrf=True \
|
17 |
--LabApp.news_url=None \
|
18 |
--LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
|
19 |
-
--notebook-dir=$NOTEBOOK_DIR
|
|
|
|
|
|
|
|
|
|
1 |
#!/bin/bash
|
2 |
JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
|
3 |
+
sed -i '/password/d' /home/user/.config/code-server/config.yaml
|
4 |
+
echo "password: ${JUPYTER_TOKEN}" >> /home/user/.config/code-server/config.yaml
|
5 |
+
cat /home/user/.config/code-server/config.yaml
|
6 |
|
7 |
NOTEBOOK_DIR="/data"
|
8 |
|
9 |
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
|
10 |
|
11 |
+
nohup jupyter-lab \
|
12 |
--ip 0.0.0.0 \
|
13 |
+
--port 8080 \
|
14 |
--no-browser \
|
15 |
--allow-root \
|
16 |
--ServerApp.token="$JUPYTER_TOKEN" \
|
|
|
19 |
--ServerApp.disable_check_xsrf=True \
|
20 |
--LabApp.news_url=None \
|
21 |
--LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
|
22 |
+
--notebook-dir=$NOTEBOOK_DIR > /data/jupyter.log 2>&1 &
|
23 |
+
|
24 |
+
sleep 30s
|
25 |
+
ps aux | grep 'jupyter' | grep -v 'grep' | awk '{print $2}' | xargs kill -9
|
26 |
+
code-server --bind-addr 0.0.0.0:8080 /data > /data/start.log 2>&1 &
|