Jupyterhub configuration for docker swarm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Point DockerSpawner to Swarm instead of the local DockerEngine | |
os.environ["DOCKER_HOST"] = ":4000" | |
# We use NGINX for SSL | |
c.JupyterHub.confirm_no_ssl = True | |
# The docker instances need access to the Hub, so the default loopback port doesn't work: | |
from IPython.utils.localinterfaces import public_ips | |
c.JupyterHub.hub_ip = public_ips()[0] | |
c.JupyterHub.spawner_class = 'dockerspawner.SystemUserSpawner' | |
# see https://hub.docker.com/r/zonca/jupyterhub-datascience-systemuser/builds/ | |
c.DockerSpawner.container_image = 'zonca/jupyterhub-datascience-systemuser' | |
c.DockerSpawner.remove_containers = True | |
# The docker instances need access to the Hub, so the default loopback port | |
# doesn't work. We need to tell the hub to listen on 0.0.0.0 because it's in a | |
# container, and we'll expose the port properly when the container is run. Then, | |
# we explicitly tell the spawned containers to connect to the proper IP address. | |
c.JupyterHub.proxy_api_ip = '0.0.0.0' | |
c.DockerSpawner.container_ip = '0.0.0.0' | |
c.DockerSpawner.use_internal_ip = False | |
c.DockerSpawner.hub_ip_connect = c.JupyterHub.hub_ip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment