Skip to content

Instantly share code, notes, and snippets.

@psychemedia
Last active February 11, 2019 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psychemedia/72d285f3ba4bb48f81859a84f9825ccf to your computer and use it in GitHub Desktop.
Save psychemedia/72d285f3ba4bb48f81859a84f9825ccf to your computer and use it in GitHub Desktop.
Can we use Jupyter server proxy to proxy things on named network?

Jupyter server proxy in a docker-compose network

Can we use Jupyter server proxy running in a Jupyter notebook container to proxy a connection from another docker-compose connected container on the same (named) Docker network?

Can we avoid a start command if the server is already running in the connected container?

version: '3.5'
services:
refine:
container_name: refine_container
image: psychemedia/openrefinedemo
ports:
- "3333:3333"
networks:
- jupyternet
restart: unless-stopped
jupyter:
container_name: refine_jupyter_notebook_container
#image: jupyter/minimal-notebook
build: ./
environment:
JUPYTER_TOKEN: 'letmein'
ports:
- "80:8888"
networks:
- jupyternet
volumes:
- ./jupyter_notebook_config.py:/home/jovyan/.jupyter/jupyter_notebook_config.py
restart: unless-stopped
networks:
jupyternet:
driver: bridge
volumes:
jupyter:
FROM jupyter/minimal-notebook
RUN pip --no-cache install git+https://github.com/jupyterhub/jupyter-server-proxy
# Traitlet configuration file for jupyter-notebook.
c.ServerProxy.servers = {
'openrefine': {
#I donlt need a command, server is already running?
#'command': ['/home/jovyan/.openrefine/openrefine-2.8/refine', '-p', '{port}','-d','/home/jovyan/openrefine'],
#Can we specify network: http://refine_container
'port': 3333,
'timeout': 120,
'launcher_entry': {
'title': 'OpenRefine'
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment