forked from jupyter/tmpnb
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
47 lines (35 loc) · 1.11 KB
/
Makefile
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
# Configuration parameters
CULL_PERIOD ?= 30
CULL_TIMEOUT ?= 60
LOGGING ?= debug
POOL_SIZE ?= 3
tmpnb-image: Dockerfile
docker build -t jupyter/tmpnb .
images: tmpnb-image demo-image minimal-image
minimal-image:
docker pull jupyter/minimal
demo-image:
docker pull jupyter/demo
proxy-image:
docker pull jupyter/configurable-http-proxy
proxy: proxy-image
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=devtoken \
--name=proxy \
jupyter/configurable-http-proxy \
--default-target http://127.0.0.1:9999
tmpnb: minimal-image tmpnb-image
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=devtoken \
--name=tmpnb \
-v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py \
--image=jupyter/minimal --cull_timeout=$(CULL_TIMEOUT) --cull_period=$(CULL_PERIOD) \
--logging=$(LOGGING) --pool_size=$(POOL_SIZE) --static-files=/srv/ipython/IPython/html/static/
dev: cleanup proxy tmpnb
cleanup:
-docker stop `docker ps -aq`
-docker rm `docker ps -aq`
-docker images -q --filter "dangling=true" | xargs docker rmi
log-tmpnb:
docker logs -f tmpnb
log-proxy:
docker logs -f proxy
.PHONY: cleanup