-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-and-run-jupyterhub.sh
executable file
·48 lines (39 loc) · 1.43 KB
/
build-and-run-jupyterhub.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
docker pull jupyterhub/singleuser:latest
docker build ./jupyter -t jupyter_atb:latest || exit 1
docker pull jupyterhub/jupyterhub:latest
docker build ./jupyterhub -t jupyterhub_atb:latest || exit 1
for container in `docker ps | grep "jupyter-" | cut -d" " -f1`; do
# leave user instances alone
echo docker kill $container
done
docker kill jupyter
docker kill jupyterhub
docker kill jupyterhub-nginx
echo y | docker system prune
sudo mkdir -p /var/lib/jupyterhub/srv
sudo mkdir -p /var/lib/jupyterhub/crontabs
mkdir -p /var/lib/jupyterhub/users
mkdir -p /var/lib/jupyterhub/shared
sudo cp -n jupyterhub_config.py /var/lib/jupyterhub/srv
sudo cp user-bootstrap.sh /var/lib/jupyterhub/srv
sudo cp nginx-jupyterhub.conf /var/lib/jupyterhub/srv
docker run -dt --restart=always \
--name jupyterhub \
-p 8000:8000 \
-p 172.17.0.1:8081:8081 \
--add-host jupyterhub:0.0.0.0 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/jupyterhub/srv:/srv/jupyterhub \
-v /var/lib/jupyterhub/users:/srv/users \
-v /var/lib/jupyterhub/shared:/srv/shared \
-v /var/lib/jupyterhub/crontabs:/var/spool/cron/crontabs \
jupyterhub_atb:latest \
jupyterhub --debug
docker run -dt --restart=always \
--name jupyterhub-nginx \
-p 80:80 \
-p 443:443 \
-v /var/lib/jupyterhub/srv/nginx-jupyterhub.conf:/etc/nginx/conf.d/nginx-jupyterhub.conf \
-v /etc/letsencrypt:/etc/letsencrypt \
nginx:latest