Outils pour utilisateurs

Outils du site


tech:notes_ipython_derriere_un_reverse_proxy

Notes IPython derrière un reverse proxy

Docker-compose

Password less.

docker-compose.yml

version: '3.7'
services:
  ipython:
    image: jupyter/base-notebook
    restart: unless-stopped
    # Warning : No password !
    command: ["start-notebook.sh", "--NotebookApp.token=''","--NotebookApp.password=''"]
    environment:
      GRANT_SUDO: "no"
    user: root
    ports:
      - '127.0.0.1:8083:8888'
    volumes:
      - ipython_work:/home/jovyan/work
    networks:
      - ipython-net

networks:
  ipython-net:
    name: ipython-net

volumes:
  ipython_work:

J'ai eu me même pb : http://stackoverflow.com/questions/22665809/how-to-configure-ipython-behind-nginx-in-a-subpath

server {
        listen 80;
        root /usr/share/nginx/www;
        index index.html index.htm index.php ;
 
        server_name notebook.mondomain.fr ;
 
        error_log /var/log/nginx/error-notebook.log;
 
 
    location / {
        proxy_pass http://localhost:5001;
 
        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_set_header X-NginX-Proxy true;
 
        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
    }
 
    location ^~ /static/ {
        alias /usr/share/ipython/notebook/static/;
    }
}
cd
mkdir books
 
 
vim ipython_notebook_config.py
c = get_config()
 
c.IPKernelApp.pylab = 'inline'  # if you want plotting support always
c.NotebookApp.open_browser = False
c.NotebookApp.port = 5001
vi /etc/cron.allow
crontab -e
@reboot cd ${HOME}/books ; ipython3 notebook --pylab=inline --no-browser --profile=notebook >${HOME}/notebook.log 2>${HOME}/notebook.err
tech/notes_ipython_derriere_un_reverse_proxy.txt · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki