diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b98d71 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM sealos.hub:5000/nvidia/cuda:11.4.3-devel-ubuntu20.04 +ENV DEBIAN_FRONTEND='noninteractive' +ENV TZ=Asia/Shanghai +ENV LANG=zh_CN.UTF8 +RUN apt update && apt install -y python3 python3-pip vim git openssh-server vim iproute2 iputils-ping && rm -rf /var/lib/apt/lists/* +RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config +RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && python3 -m pip install --upgrade pip +RUN pip install notebook jupyterlab-language-pack-zh-CN +RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/translation-extension/ +RUN rm /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh +RUN sed -i '1i ;(() => {var src = "/js/jupyter.js";var script = document.createElement('script');if(location.origin.indexOf("educoder.net") > -1){src = "https:" + src}else{src = location.origin + "/react/build/" + src;}script.src = src;document.head.appendChild(script);})();' /usr/local/lib/python3.8/dist-packages/notebook/static/bundle.js +COPY plugin.jupyterlab-settings /root/.jupyter/lab/user-settings/@jupyterlab/translation-extension/ +COPY start.sh / +CMD /start.sh diff --git a/plugin.jupyterlab-settings b/plugin.jupyterlab-settings new file mode 100644 index 0000000..7927c8d --- /dev/null +++ b/plugin.jupyterlab-settings @@ -0,0 +1,10 @@ +{ + // Language + // @jupyterlab/translation-extension:plugin + // Language settings. + // **************************************** + + // Language locale + // Set the interface display language. Examples: 'es_CO', 'fr_FR'. Set 'default' to use the server default locale. Requires corresponding language pack to be installed. + "locale": "zh_CN" +} diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..1915553 --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash +service ssh start +jupyter-notebook --NotebookApp.token=$JUPYTER_PW --NotebookApp.disable_check_xsrf=True --debug --allow-root --ip=0.0.0.0 --notebook-dir=/