-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
79 lines (60 loc) · 3.24 KB
/
notes.txt
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
sudo docker pull nginx
sudo docker run --name docker-nginx -p 80:80 nginx
# Detached mode
sudo docker run --name docker-nginx -p 80:80 -d nginx
sudo docker ps
sudo docker stop docker-nginx
sudo docker ps -a
mkdir html
cp index.html html
docker run --name docker-nginx -p 80:80 -v ~/html:/usr/share/nginx/html -d nginx
# -v ~/docker-nginx/default.conf:/etc/nginx/conf.d/default.conf
# Dockerfile
#FROM nginx
#ADD nginx.conf /etc/nginx/nginx.conf
docker pull jupyter/minimal-notebook
export TOKEN=$( head -c 30 /dev/urandom | xxd -p )
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=tmpnb -v /var/run/docker.sock:/docker.sock jupyter/tmpnb
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8000
docker run -d --name configproxy --net=host -e CONFIGPROXY_AUTH_TOKEN=LEGIT_KEY jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
docker run -d --name tmpnb --net=host -e CONFIGPROXY_AUTH_TOKEN=LEGIT_KEY -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py --cull-timeout=120 --docker-version=1.13 --pool-size=512 --image=jupyter/demo --static-files=/srv/ipython/IPython/html/static/ --redirect-uri=/tree --command='ipython3 notebook --NotebookApp.base_url={base_path}' --max-dock-workers=8
tmpnb nginx setup
This host should have its own DNS record for the redirector to point to, e.g. yetanother.tmpnb.org
apt-get update && apt-get upgrade -y && apt-get install nginx
mkdir -p /var/www/tmpnb-static && cd /var/www/tmpnb-static
# Grab the static.tar *somehow*
tar -xvf static.tar
# Grab the nginx configuration *somehow*
cp nginx.conf /etc/nginx/sites-available/default
# Change the nginx configuration to point to the tmpnb node that this server goes with
# Put the certs in `/etc/ssl`
service nginx restart
https://raw.githubusercontent.com/ProjectPyRhO/PyRhO/master/pyrho/gui/PyRhO_logo.png
# Original ga.html
# Differences (apart from UA)
- missing https: before //www.google-analytics.com/analytics.js
- has an extra line: ga('require', 'displayfeatures');
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-56096826-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
# Do I copy in templates? static? where? how are they included?
# Do I still need a jupyter_notebook_config.py ? This might be for JupyterHub - see issue 379
# Does orchestrate handle all the templates now? --NotebookApp.base_url={base_path} --NotebookApp.trust_xheaders=True"
docker run -d \
--net=host \
-e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
-v /var/run/docker.sock:/docker.sock \
jupyter/tmpnb \
python orchestrate.py --image='jupyter/minimal-notebook' \
--command='start-notebook.sh \
"--NotebookApp.base_url={base_path} \
--ip=0.0.0.0 \
--port={port} \
--NotebookApp.trust_xheaders=True"'