Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Commit

Permalink
Link containers instead of querying IP.
Browse files Browse the repository at this point in the history
Add network logging support (and Makefile rule).

Refs #6

(c) Copyright IBM Corp. 2016
  • Loading branch information
dalogsdon committed Jan 13, 2016
1 parent 180bf3c commit 40e1d90
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ USER node
RUN npm run build

EXPOSE 3000
ENTRYPOINT ["npm", "run", "start"]
ENTRYPOINT ["npm", "run"]
CMD ["start"]
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

.PHONY: help build run run-kernel-gateway kill dev-install dev debug _dev-install-ipywidgets
.PHONY: help build run run-debug run-kernel-gateway kill dev-install dev debug _dev-install-ipywidgets

DASHBOARD_CONTAINER_NAME=dashboard-proxy
DASHBOARD_IMAGE_NAME=jupyter-incubator/$(DASHBOARD_CONTAINER_NAME)
KG_CONTAINER_NAME=kernel_gateway

KG_IP_CMD=docker inspect --format '{{ .NetworkSettings.IPAddress }}' $(KG_CONTAINER_NAME)

help:
@echo 'Make commands:'
@echo ' build - builds Docker image for dashboard proxy app'
@echo ' run - runs the dashboard proxy and kernel gateway containers'
@echo ' run-debug - like `run` but with node network logging enabled'
@echo ' kill - stops both containers'

build:
@docker build -t $(DASHBOARD_IMAGE_NAME) .

run: build run-kernel-gateway
@kgip=`$(KG_IP_CMD)`; \
docker run -it --rm \
run: CMD?=
run: | build run-kernel-gateway
@docker run -it --rm \
--name $(DASHBOARD_CONTAINER_NAME) \
-p 9700:3000 \
-e KERNEL_GATEWAY_URL=http://$$kgip:8888 \
$(DASHBOARD_IMAGE_NAME)
-e KERNEL_GATEWAY_URL=http://$(KG_CONTAINER_NAME):8888 \
--link $(KG_CONTAINER_NAME):$(KG_CONTAINER_NAME) \
$(DASHBOARD_IMAGE_NAME) $(CMD)

run-debug:
$(MAKE) run CMD=start-debug

# TODO change to proper kernel-gateway minimal image
run-kernel-gateway: KG_IMAGE?=jupyter-incubator/all-spark-kernels
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"build": "gulp build",
"bower": "bower install",
"start": "node ./bin/www",
"start-debug": "NODE_DEBUG=http DEBUG=express:*,dashboard-proxy:* node ./bin/www",
"test": "node_modules/mocha/bin/mocha test/**/*-test.js"
},
"dependencies": {
Expand Down

0 comments on commit 40e1d90

Please sign in to comment.