13

docker部署jupyter并nginx反向代理

 3 years ago
source link: https://www.ishells.cn/archives/jupyter-docker-nginx
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
docker部署jupyter并nginx反向代理

docker部署jupyter并nginx反向代理

14 次访问 2021-08-30
枕头下臭袜子
Scroll Down

docker部署jupyter非常简单,一行命令即可

1、docker部署jupyter note

# docker run --name jupyter -d -p 映射本地端口:8888 -v ~/本地路径/:/home/jovyan/work  jupyter/base-notebook

2、使用本地nginx反向代理

# 如果nginx配置不这样书写,会出现无法连接到python内核的问题server {    # 我这里使用的域名    server_name XXXXXX;     client_max_body_size 1024m;     location / {        proxy_pass http://127.0.0.1:本地端口/;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header Host $host;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_http_version 1.1;        proxy_set_header Upgrade $http_upgrade;        proxy_set_header Connection "upgrade";        proxy_redirect off;    }}

没有特殊使用需求的情况下,是不需要修改jupyter notebook的配置文件的,如果有使用nginx反向代理使用域名解析的话,nginx配置就按照上边的配置即可。如另外需要https,作为一位老手相信你也处理的来,使用certbot --nginx即可

参考:
https://www.thincliff.com/docker-jupyter%E5%AE%89%E8%A3%85%E4%BB%A5%E5%8F%8A%E8%AE%BE%E7%BD%AEnginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK