修改: Dockerfile

新文件:   jupyter_notebook_config.py
	新文件:   notification.jupyterlab-settings
main
root 5 months ago
parent f4efaf8a89
commit 32f3595526

@ -6,13 +6,12 @@ ENV LANG=zh_CN.UTF8
RUN apt update && apt install -y tzdata python3 python3-pip vim git openssh-server vim iproute2 iputils-ping unzip RUN apt update && apt install -y tzdata python3 python3-pip vim git openssh-server vim iproute2 iputils-ping unzip
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config 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 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && python3 -m pip install --upgrade pip
RUN pip install notebook==7.2.1 jupyterlab-language-pack-zh-CN==4.2.post1 jieba transformers scikit-learn opencv-python RUN pip install notebook==7.2.1 jupyterlab-language-pack-zh-CN==4.2.post1
RUN pip install opencv-python-headless -i https://pypi.tuna.tsinghua.edu.cn/simple RUN mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/translation-extension/ && mkdir -p /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/
RUN pip install torch==2.3.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
COPY bert-base-chinese/ /opt/
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 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/share/jupyter/lab/static/main.ff3db1deac539c231382.js 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/share/jupyter/lab/static/main.ff3db1deac539c231382.js
COPY plugin.jupyterlab-settings /root/.jupyter/lab/user-settings/@jupyterlab/translation-extension/ COPY plugin.jupyterlab-settings /root/.jupyter/lab/user-settings/@jupyterlab/translation-extension/
COPY notification.jupyterlab-settings /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/
#COPY jupyter_notebook_config.py /etc/jupyter/
COPY start.sh / COPY start.sh /
CMD /start.sh CMD /start.sh

@ -0,0 +1,17 @@
import os
c.NotebookApp.allow_remote_access = True
#c.NotebookApp.default_url = '/jupyter/lab?reset'
c.ServerApp.allow_origin = '*'
c.NotebookApp.allow_origin = '*'
c.NotebookApp.ip = '*'
c.NotebookApp.notebook_dir = '/'
c.NotebookApp.open_browser = False
c.NotebookApp.password = ''
c.NotebookApp.password_required = False
c.NotebookApp.port = 80
c.NotebookApp.base_url = "jupyter/" + os.getenv('JUPYTERSVC')
#c.NotebookApp.base_url = "/"
c.LabApp.disable_check_xsrf = True
c.NotebookApp.disable_check_xsrf = True
c.NotebookApp.tornado_settings = {'headers': { 'Content-Security-Policy': "frame-ancestors * 'self'" } }
c.NotebookApp.default_show_linenumbers = True

@ -0,0 +1,10 @@
{
// 通知
// @jupyterlab/apputils-extension:notification
// 通知设置
// *******************************************
// 获取Jupyter官方新闻
// 是否从 Jupyter 新闻源获取新闻。如果设置为 `true`,它将向网站提出请求。
"fetchNews": "false"
}
Loading…
Cancel
Save