lab default.

This commit is contained in:
Michael Pilosov 2019-04-10 18:51:04 -06:00
parent c8e6eafa3a
commit 59e1da6c6c
2 changed files with 3 additions and 2 deletions

2
.env
View File

@ -12,7 +12,7 @@ JUPYTERHUB_VERSION=0.9.4
# Assign a port for the hub to be hosted on.
# To check the ports that are in use, run `docker ps`.
# Generally, picking a random number between 8000-9999 won't be an issue.
PORT_NUM=8000
PORT_NUM=8001
HUB_NAME=math
# Name of Docker network

View File

@ -46,6 +46,7 @@ class MyDockerSpawner(DockerSpawner):
if self.user.name == 'hub-admin': # if admin, allow userlist access
self.volumes[os.path.join(pwd,'userlist')] = { 'bind': '/home/jovyan/userlist',
'mode': 'rw' }
self.environment['JUPYTER_ENABLE_LAB'] = 'yes'
return super().start()
c.JupyterHub.spawner_class = MyDockerSpawner
@ -89,7 +90,7 @@ c.DockerSpawner.extra_host_config = { 'network_mode': network_name }
# user `jovyan`, and set the notebook directory to `/home/jovyan/work`.
# We follow the same convention.
notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan/work'
c.DockerSpawner.notebook_dir = notebook_dir
#c.DockerSpawner.notebook_dir = notebook_dir
# Mount the real user's Docker volume on the host to the notebook user's
# notebook directory in the container
c.DockerSpawner.volumes = { 'hub-user-{username}': notebook_dir }