You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **jupyterhub-deploy-docker** repository provides a reference
12
+
**jupyterhub-deploy-docker** provides a reference
13
13
deployment of [JupyterHub](https://github.com/jupyter/jupyterhub), a
14
14
multi-user [Jupyter Notebook](http://jupyter.org/) environment, on a
15
15
**single host** using [Docker](https://docs.docker.com).
16
16
17
-
Possible **use cases** for this deployment may include, but are not
18
-
limited to:
17
+
Possible **use cases** include, but are not limited to:
19
18
20
-
* A JupyterHub demo environment that you can spin up relatively quickly.
21
-
* A multi-user Jupyter Notebook environment for small classes, teams,
22
-
or departments.
19
+
* Creating a JupyterHub demo environment that you can spin up relatively
20
+
quickly.
21
+
* Providing a multi-user Jupyter Notebook environment for small classes,
22
+
teams, or departments.
23
23
24
24
**Disclaimer:** This deployment is **NOT** intended for a production
25
25
environment.
@@ -51,82 +51,115 @@ Key components of this reference deployment are:
51
51
52
52
## Prerequisites
53
53
54
-
***Docker**: This deployment uses Docker for all the things, via
55
-
[Docker Compose](https://docs.docker.com/compose/overview/). It
56
-
requires [Docker Engine](https://docs.docker.com/engine) 1.12.0 or
57
-
higher. Use the [Docker installation instructions](https://docs.docker.com/engine/installation/)
58
-
for your environment.
59
-
60
-
***HTTPS and SSL**: This deployment configures JupyterHub to use HTTPS
61
-
connections (the default). You must provide TLS certificate chain and
62
-
key files in the JupyterHub configuration. If you do not have an
63
-
existing certificate chain and key, you can [create self-signed versions](https://jupyter-notebook.readthedocs.org/en/latest/public_server.html#using-ssl-for-encrypted-communication),
64
-
or obtain real ones from [Let's Encrypt](https://letsencrypt.org)
65
-
(see the [letsencrypt example](examples/letsencrypt/README.md) for
66
-
instructions).
54
+
### Docker
55
+
56
+
This deployment uses Docker for all the things, via [Docker Compose](https://docs.docker.com/compose/overview/).
57
+
[Docker Engine](https://docs.docker.com/engine) 1.12.0 or higher is
58
+
required. Use [Docker's installation instructions](https://docs.docker.com/engine/installation/)
59
+
to set up Docker for your environment.
67
60
68
-
To verify that you are set up with docker, via a local installation or
69
-
[docker-machine](./docs/docker-machine.md), run:
61
+
To verify your docker installation, whether running docker as a local installation or using [docker-machine](./docs/docker-machine.md),
62
+
enter these commands:
70
63
71
64
```bash
65
+
docker version
72
66
docker ps
73
67
```
74
68
75
-
This command will return running Docker processes.
69
+
70
+
71
+
### HTTPS and SSL/TLS certificate
72
+
73
+
This deployment configures JupyterHub to use HTTPS connections (the
74
+
default). You must provide TLS certificate chain and key file in the
75
+
JupyterHub configuration.
76
+
77
+
1. Obtain the domain name that you wish to use for JupyterHub, for
78
+
example, `myfavoritesite.com` or `jupiterplanet.org`.
79
+
80
+
1. If you do not have an existing certificate chain and key, you can
**Note:** The `.env` file is a special file that Docker Compose uses
136
+
to lookup environment variables. If you choose to place the GitHub
137
+
OAuth application settings in this file, you should make sure that the
138
+
file remains private (be careful to not commit the `.env` file with
139
+
these secrets to source control).
104
140
105
-
## Build the JupyterHub Docker image
106
141
107
-
Configure JupyterHub and build it into a Docker image.
142
+
## Build the JupyterHub Docker image
108
143
109
-
1. Copy the TLS certificate chain and key files for the JupyterHub server to a directory named `secrets` within this repository directory. These will be added to the JupyterHub Docker image at build time. If you do not have a certificate chain and key, you can either [create self-signed versions](https://jupyter-notebook.readthedocs.org/en/latest/public_server.html#using-ssl-for-encrypted-communication), or obtain real ones from [Let's Encrypt](https://letsencrypt.org) (see the [letsencrypt example](examples/letsencrypt/README.md) for instructions).
144
+
Configure JupyterHub
110
145
111
-
```
112
-
mkdir -p secrets
113
-
cp jupyterhub.crt jupyterhub.key secrets/
114
-
```
146
+
and build it into a Docker image.
115
147
116
148
1. Create a `userlist` file with a list of authorized users. At a minimum, this file should contain a single admin user. The username should be a GitHub username. For example:
117
149
118
-
```
150
+
**file**
151
+
```
119
152
jtyberg admin
120
-
```
153
+
```
121
154
122
155
The admin user will have the ability to add more users in the JupyterHub admin console.
123
156
124
157
1. Use [docker-compose](https://docs.docker.com/compose/reference/) to build the
125
158
JupyterHub Docker image on the active Docker machine host:
126
159
127
-
```
160
+
```bash
128
161
make build
129
-
```
162
+
```
130
163
131
164
132
165
## Spawner: Prepare the Jupyter Notebook Image
@@ -159,7 +192,7 @@ Notebook server that is compatible with JupyterHub).
159
192
160
193
You can pull the image using the following command:
161
194
162
-
```
195
+
```bash
163
196
make notebook_image
164
197
```
165
198
@@ -170,19 +203,20 @@ Run the JupyterHub container on the host.
170
203
171
204
To run the JupyterHub container in detached mode:
172
205
173
-
```
206
+
```bash
174
207
docker-compose up -d
175
208
```
176
209
177
210
Once the container is running, you should be able to access the JupyterHub console at
178
211
212
+
**file**
179
213
```
180
214
https://myhost.mydomain
181
215
```
182
216
183
217
To bring down the JupyterHub container:
184
218
185
-
```
219
+
```bash
186
220
docker-compose down
187
221
```
188
222
@@ -192,6 +226,14 @@ docker-compose down
192
226
193
227
`make build` does a few things behind the scenes, to set up the environment for JupyterHub:
194
228
229
+
### Create a JupyterHub Data Volume
230
+
231
+
Create a Docker volume to persist JupyterHub data. This volume will reside on the host machine. Using a volume allows user lists, cookies, etc., to persist across JupyterHub container restarts.
232
+
233
+
```bash
234
+
docker volume create --name jupyterhub-data
235
+
```
236
+
195
237
### Create a Docker Network
196
238
197
239
Create a Docker network for inter-container communication. The benefits of using a Docker network are:
@@ -201,18 +243,10 @@ Create a Docker network for inter-container communication. The benefits of usin
201
243
202
244
Here we create a Docker network named `jupyterhub-network`. Later, we will configure the JupyterHub and single-user Jupyter Notebook containers to run attached to this network.
203
245
204
-
```
246
+
```bash
205
247
docker network create jupyterhub-network
206
248
```
207
249
208
-
### Create a JupyterHub Data Volume
209
-
210
-
Create a Docker volume to persist JupyterHub data. This volume will reside on the host machine. Using a volume allows user lists, cookies, etc., to persist across JupyterHub container restarts.
0 commit comments