From 69da3bcd45ebb99ae7788e71b090a624e6a67663 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 13 Jul 2018 15:39:30 -0500 Subject: [PATCH] Update Dockerfile to run on binder. Remove running as root, set a jovyan user, and update a few other related configurations. --- Dockerfile | 24 +++++++++++++++++++----- README.md | 2 +- notebooks/01_Example.ipynb | 2 +- requirements.txt | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b7f5569..f70ef95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,9 +24,7 @@ RUN apt-get install -y git \ python-cffi \ python-lxml \ python-pil \ - python-numpy \ python-scipy \ - python-pandas \ python-matplotlib \ python-seaborn \ python-concurrent.futures \ @@ -68,7 +66,23 @@ RUN . /root/.bashrc && pip2.7 install -U -r prerequirements.txt && \ jupyter serverextension enable --py geonotebook --sys-prefix && \ jupyter nbextension enable --py geonotebook --sys-prefix -VOLUME /notebooks -WORKDIR /notebooks -ENTRYPOINT ["/jupyter.sh"] +ENV NB_USER jovyan +ENV NB_UID 1000 +ENV HOME /home/${NB_USER} + +WORKDIR ${HOME} + +RUN adduser --disabled-password \ + --gecos "Default user" \ + --uid ${NB_UID} \ + ${NB_USER} + +# Make sure the contents of our repo are in ${HOME} +COPY . ${HOME} +USER root +RUN chown -R ${NB_UID} ${HOME} +USER ${NB_USER} + + +CMD ["jupyter", "notebook", "--ip", "0.0.0.0"] diff --git a/README.md b/README.md index fef5ad8..99acee0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## GeoNotebook [![CircleCI](https://circleci.com/gh/OpenGeoscience/geonotebook.svg?style=shield)](https://circleci.com/gh/OpenGeoscience/geonotebook) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/OpenGeoscience/geonotebook) +## GeoNotebook [![CircleCI](https://circleci.com/gh/OpenGeoscience/geonotebook.svg?style=shield)](https://circleci.com/gh/OpenGeoscience/geonotebook) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/OpenGeoscience/geonotebook) [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/OpenGeoscience/geonotebook/master) GeoNotebook is an application that provides client/server environment with interactive visualization and analysis capabilities using [Jupyter](http://jupyter.org), [GeoJS](http://www.github.com/OpenGeoscience/geojs) and other open source tools. diff --git a/notebooks/01_Example.ipynb b/notebooks/01_Example.ipynb index 96e1b39..0a9d638 100644 --- a/notebooks/01_Example.ipynb +++ b/notebooks/01_Example.ipynb @@ -93,7 +93,7 @@ }, "outputs": [], "source": [ - "!jupyter nbextension enable --py widgetsnbextension --sys-prefix" + "!jupyter nbextension enable --py widgetsnbextension" ] }, { diff --git a/requirements.txt b/requirements.txt index 97b333b..4e9873d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ promise==0.4.2 Shapely==1.5.17 fiona==1.7.1 six==1.10.0 -ipykernel==4.5.2 +ipykernel matplotlib pyproj pandas