|
| 1 | +sudo docker pull nginx |
| 2 | +sudo docker run --name docker-nginx -p 80:80 nginx |
| 3 | +# Detached mode |
| 4 | +sudo docker run --name docker-nginx -p 80:80 -d nginx |
| 5 | +sudo docker ps |
| 6 | +sudo docker stop docker-nginx |
| 7 | +sudo docker ps -a |
| 8 | +mkdir html |
| 9 | +cp index.html html |
| 10 | +docker run --name docker-nginx -p 80:80 -v ~/html:/usr/share/nginx/html -d nginx |
| 11 | + |
| 12 | +# -v ~/docker-nginx/default.conf:/etc/nginx/conf.d/default.conf |
| 13 | + |
| 14 | +# Dockerfile |
| 15 | +#FROM nginx |
| 16 | +#ADD nginx.conf /etc/nginx/nginx.conf |
| 17 | + |
| 18 | + |
| 19 | +docker pull jupyter/minimal-notebook |
| 20 | +export TOKEN=$( head -c 30 /dev/urandom | xxd -p ) |
| 21 | +docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999 |
| 22 | +docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=tmpnb -v /var/run/docker.sock:/docker.sock jupyter/tmpnb |
| 23 | + |
| 24 | + |
| 25 | +iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8000 |
| 26 | +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 |
| 27 | +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 |
| 28 | + |
| 29 | +tmpnb nginx setup |
| 30 | + |
| 31 | +This host should have its own DNS record for the redirector to point to, e.g. yetanother.tmpnb.org |
| 32 | + |
| 33 | +apt-get update && apt-get upgrade -y && apt-get install nginx |
| 34 | +mkdir -p /var/www/tmpnb-static && cd /var/www/tmpnb-static |
| 35 | +# Grab the static.tar *somehow* |
| 36 | +tar -xvf static.tar |
| 37 | + |
| 38 | +# Grab the nginx configuration *somehow* |
| 39 | +cp nginx.conf /etc/nginx/sites-available/default |
| 40 | +# Change the nginx configuration to point to the tmpnb node that this server goes with |
| 41 | + |
| 42 | +# Put the certs in `/etc/ssl` |
| 43 | + |
| 44 | +service nginx restart |
| 45 | + |
| 46 | + |
| 47 | +https://raw.githubusercontent.com/ProjectPyRhO/PyRhO/master/pyrho/gui/PyRhO_logo.png |
| 48 | + |
| 49 | +# Original ga.html |
| 50 | +# Differences (apart from UA) |
| 51 | +- missing https: before //www.google-analytics.com/analytics.js |
| 52 | +- has an extra line: ga('require', 'displayfeatures'); |
| 53 | + |
| 54 | +<script> |
| 55 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| 56 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| 57 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 58 | + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
| 59 | + |
| 60 | + ga('create', 'UA-56096826-1', 'auto'); |
| 61 | + ga('require', 'displayfeatures'); |
| 62 | + ga('send', 'pageview'); |
| 63 | +</script> |
| 64 | + |
| 65 | +# Do I copy in templates? static? where? how are they included? |
| 66 | +# Do I still need a jupyter_notebook_config.py ? This might be for JupyterHub - see issue 379 |
| 67 | +# Does orchestrate handle all the templates now? --NotebookApp.base_url={base_path} --NotebookApp.trust_xheaders=True" |
| 68 | + |
| 69 | +docker run -d \ |
| 70 | + --net=host \ |
| 71 | + -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \ |
| 72 | + -v /var/run/docker.sock:/docker.sock \ |
| 73 | + jupyter/tmpnb \ |
| 74 | + python orchestrate.py --image='jupyter/minimal-notebook' \ |
| 75 | + --command='start-notebook.sh \ |
| 76 | + "--NotebookApp.base_url={base_path} \ |
| 77 | + --ip=0.0.0.0 \ |
| 78 | + --port={port} \ |
| 79 | + --NotebookApp.trust_xheaders=True"' |
0 commit comments