Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Question: How to add notebooks when using docker-compose? #264

Open
MattKravetz opened this issue Feb 9, 2017 · 1 comment
Open

Question: How to add notebooks when using docker-compose? #264

MattKravetz opened this issue Feb 9, 2017 · 1 comment

Comments

@MattKravetz
Copy link

MattKravetz commented Feb 9, 2017

Hi all,

I would like to set up a tmpnb container using docker-compose that will display several pre-built jupyter notebooks to users. This seems like it should be fairly straightforward to do, but I am not seeing this information in the readme or any other issues.

I am using the docker-compose.yml provided in the readme, and have modified it to set the --home_directories flag to the "notebooks" folder on my docker machine that I would like to mount. The notebooks are available in the spawned containers, in the mnt/vol0/ directory, but they are not visible to users in the notebook list. How do I get them in the [user hash]/tree directory?

Thanks!

@MattKravetz MattKravetz changed the title Adding notebooks when using docker-compose Question: How to add notebooks when using docker-compose Feb 9, 2017
@MattKravetz MattKravetz changed the title Question: How to add notebooks when using docker-compose Question: How to add notebooks when using docker-compose? Feb 9, 2017
@MattKravetz
Copy link
Author

MattKravetz commented Feb 10, 2017

Hi all,

I got this to work by using a fork of this project, created by apurva3000 (link: https://github.com/apurva3000/tmpnb/tree/user_mount_point). In case anyone else is running into the same issue, the docker-compose.yml file copied below worked for me. /path/on/docker/machine/ in the snippet below should be replaced with whatever folder you want to appear in the notebooks list. I'm sure there has to be a more straightforward way of adding notebooks... but this will get the job done!

httpproxy:
  image: jupyter/configurable-http-proxy
  environment:
    CONFIGPROXY_AUTH_TOKEN: 716238957362948752139417234
  container_name:  tmpnb-proxy
  net: "host"
  command: --default-target http://127.0.0.1:9999
  ports:
    - 8000:8000

tmpnb_orchestrate:
  build: .
  net: "host"
  container_name: tmpnb_orchestrate
  environment:
    CONFIGPROXY_AUTH_TOKEN: 716238957362948752139417234
  volumes:
    - /var/run/docker.sock:/docker.sock
  command: python orchestrate.py --host_directories="/path/on/docker/machine/:/home/jovyan/work/:ro" --command='jupyter notebook --no-browser --port {port} --ip=0.0.0.0 --NotebookApp.base_url={base_path} --NotebookApp.port_retries=0 --NotebookApp.token="" --NotebookApp.disable_check_xsrf=True'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant