See original repository.
This deployment uses GitLab OAuth to authenticate users.
-
add variables to an
oauth.env
file in thesecrets
directory of this repository. You may need to create both thesecrets
directory and theoauth.env
file. For example, add the following lines in theoauth.env
file:oauth.env
fileOAUTH_CLIENT_ID=<gitlab_client_id> OAUTH_CLIENT_SECRET=<gitlab_client_secret> OAUTH_CALLBACK_URL=http://<myaddress>:8001/hub/oauth_callback GITLAB_HOST=https://<gitlab_address>
Note: The
oauth.env
file is a special file that Docker Compose uses to lookup environment variables. If you choose to place the GitHub OAuth application settings in this file, you should make sure that the file remains private (be careful to not commit theoauth.env
file with these secrets to source control).
Create a GitLab OAuth application.
-
add variables to an
postgres.env
file in thesecrets
directory of this repository.postgres.env
filePOSTGRES_PASSWORD=mysecretpassword
Finish configuring JupyterHub and then build the hub's Docker image. (We'll build the Jupyter Notebook image in the next section.)
-
Configure
userlist
: Create auserlist
file of authorized JupyterHub users. The list should contain GitHub usernames, and this file should designate at least oneadmin
user. For instance, the example file below contains three users,jtyberg
,jenny
, andguido
, and one designated administrator,jtyberg
:userlist
filejtyberg admin jenny guido
The admin user will have the ability to add more users through JupyterHub's admin console.
-
Use docker-compose to build the JupyterHub Docker image on the active Docker machine host by running the
make build
command:make build
Build and tag the image using the Dockerfile
in notebook-with-gpu
directory.
cd notebook-with-gpu
docker build -t jupyterhub-gpu-notebook .
Run the JupyterHub container on the host.
To run the JupyterHub container in detached mode:
docker-compose up -d
Once the container is running, you should be able to access the JupyterHub console at
http://<myaddress>:8001
To bring down the JupyterHub container:
docker-compose down