blog.morishin.me

Quickly Set Up Your Own nbviewer with Docker and nginx-proxy

This article is translated from Japanese using AI

When you want to share Jupyter notebooks with others, nbviewer is very convenient. There is an official page, but it seems you can easily set it up with Docker, so I decided to create my own.

  1. Set up a record like nbviewer.example.com in your DNS settings pointing to the IP address of your Docker host.
  2. Launch nginx-proxy as per the official README
    $ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
  3. Launch nbviewer by specifying the domain in VIRTUAL_HOST
    $ docker run -d -e VIRTUAL_HOST=nbviewer.example.com -e GITHUB_API_TOKEN=<YOUR_API_TOKEN> jupyter/nbviewer
  4. Open http://nbviewer.example.com in your browser.

That's it. nginx-proxy is amazing.