Skip to content

Commit f381589

Browse files
author
Luca De Feo
committed
Added readme, simplified config
1 parent afb8a91 commit f381589

File tree

4 files changed

+74
-5
lines changed

4 files changed

+74
-5
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# A name for this Docker Compose application, it can be whatever you like
12
COMPOSE_PROJECT_NAME=jupyterhub
3+
4+
# The server where this JupyterHub server is hosted
5+
HOST=jupyter.ens.uvsq.fr

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# JupyterHub deployment in use at Université de Versailles
2+
3+
This is a [JupyterHub](https://jupyter.org/hub) deployment based on
4+
Docker currently in use at [Université de
5+
Versailles](https://jupyter.ens.uvsq.fr/).
6+
7+
## Features
8+
9+
- Containerized single user Jupyter servers, using
10+
[DockerSpawner](https://github.com/jupyterhub/dockerspawner);
11+
- Central authentication to the University CAS server;
12+
- User data persistence;
13+
- HTTPS proxy.
14+
15+
## Learn more
16+
17+
This deployment is described in depth in [this blog
18+
post](https://opendreamkit.org/2018/10/17/jupyterhub-docker/).
19+
20+
### Adapt to your needs
21+
22+
This deployment is ready to clone and roll on your own server. Read
23+
the [blog
24+
post](https://opendreamkit.org/2018/10/17/jupyterhub-docker/) first,
25+
to be sure you understand the configuration.
26+
27+
Then, if you like, clone this repository and apply (at least) the
28+
following changes:
29+
30+
- In [`.env`](.env), set the variable `HOST` to the name of the server you
31+
intend to host your deployment on.
32+
- In [`reverse-proxy/traefik.toml`](reverse-proxy/traefik.toml), edit
33+
the paths in `certFile` and `keyFile` and point them to your own TLS
34+
certificates. Possibly edit the `volumes` section in the
35+
`reverse-proyx` service in
36+
[`docker-compose.yml`](docker-compose.yml).
37+
- In
38+
[`jupyterhub/jupyterhub_config.py`](jupyterhub/jupyterhub_config.py),
39+
edit the *"Authenticator"* section according to your institution
40+
authentication server. If in doubt, [read
41+
here](https://jupyterhub.readthedocs.io/en/stable/getting-started/authenticators-users-basics.html).
42+
43+
Other changes you may like to make:
44+
45+
- Edit [`jupyterlab/Dockerfile`](jupyterlab/Dockerfile) to include the
46+
software you like. Do not forget to change
47+
[`jupyterhub/jupyterhub_config.py`](jupyterhub/jupyterhub_config.py)
48+
accordingly, in particular the *"user data persistence"* section.
49+
50+
### Run!
51+
52+
Once you are ready, build and launch the application with
53+
54+
```
55+
docker-compose build
56+
docker-compose up -d
57+
```
58+
59+
Read the [Docker Compose manual](https://docs.docker.com/compose/) to
60+
learn how to manage your application.
61+
62+
## Acknowledgements
63+
64+
Work partially funded by [OpenDreamKit](https://opendreamkit.org/).

docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ services:
99
- /var/run/docker.sock:/var/run/docker.sock
1010
- jupyterhub_data:/srv/jupyterhub
1111
environment:
12-
DOCKER_JUPYTER_CONTAINER: jupyterlab_img
13-
DOCKER_NETWORK_NAME: ${COMPOSE_PROJECT_NAME}_default
14-
HUB_IP: jupyterhub
12+
- DOCKER_JUPYTER_CONTAINER=jupyterlab_img
13+
- DOCKER_NETWORK_NAME=${COMPOSE_PROJECT_NAME}_default
14+
- HUB_IP=jupyterhub
15+
- HOST
1516
labels:
1617
- "traefik.enable=true"
17-
- "traefik.frontend.rule=Host:jupyter.ens.uvsq.fr"
18+
- "traefik.frontend.rule=Host:${HOST}"
1819
restart: on-failure
1920

2021
jupyterlab:

jupyterhub/jupyterhub_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
c.CASAuthenticator.cas_service_validate_url = 'https://cas.uvsq.fr/serviceValidate'
1515

1616
# The service URL the CAS server will redirect the browser back to on successful authentication.
17-
c.CASAuthenticator.cas_service_url = 'https://sage.prism.uvsq.fr/hub/login'
17+
c.CASAuthenticator.cas_service_url = 'https://%s/hub/login' % os.environ['HOST']
1818

1919
c.Authenticator.admin_users = { 'lucadefe' }
2020

0 commit comments

Comments
 (0)