Running Jupyter notebooks inside ShinyProxy
Running Jupyter notebooks inside ShinyProxy
ShinyProxy can run Jupyter notebooks using one of their official Docker images. However, you can adapt these Docker images, such that links inside the notebook are not opened in a new tab. See the official documentation. In addition, you may want to mount a volume for persisting your notebooks. In that case you need to tell the image to use the correct permissions for the volume. Both changes are applied in the openanalytics/shinyproxy-jupyter-datascience image. This image is built from the Dockerfile in this repo.
Building the Docker image
To pull the image made in this repository from Docker Hub, use
sudo docker pull openanalytics/shinyproxy-jupyter-datascience
The relevant Docker Hub repository can be found at
To build the image from the Dockerfile, navigate into the root directory of this repository and run
sudo docker build -t openanalytics/shinyproxy-jupyter-datascience .
ShinyProxy Configuration
Note: ShinyProxy 2.6.0 or later is required for running Jupyter notebooks.
Create a ShinyProxy configuration file (see application.yml for a complete file)
proxy:
specs:
- id: jupyter-notebook-lab
display-name: Jupyter Notebook Lab
description: Jupyter Notebook running in lab mode.
container-cmd: ["start-notebook.sh", "--NotebookApp.token=''", "--NotebookApp.baseurl=#{proxy.getRuntimeValue('SHINYPROXYPUBLIC_PATH')}"]
container-image: openanalytics/shinyproxy-jupyter-datascience
container-volumes: [ "/tmp/jupyter/#{proxy.userId}/work:/home/jovyan/work"]
port: 8888
websocket-reconnection-mode: None
target-path: "#{proxy.getRuntimeValue('SHINYPROXYPUBLICPATH')}"
Note: this will mount /tmp/jupyter/#{proxy.userId} as the workspace for storing the Jupyter notebooks. You can save your notebooks in the work directory. The next time you start the Jupyter application (i.e. after logging out), your files are available again.
Screenshots

(c) Copyright Open Analytics NV, 2021-2024.