Permalink
Browse files

Has an option for putting a password on jupyter notebook

  • Loading branch information...
sachinruk committed Sep 20, 2018
1 parent 54e1906 commit 61cd26eb1e05966b246b535f8ea11e5b676df15b
Showing with 20 additions and 1 deletion.
  1. +3 −1 Dockerfile
  2. +17 −0 jupyter_notebook_config.py
View
@@ -26,7 +26,7 @@ RUN conda install -y \
RUN conda config --append channels conda-forge
RUN conda install feather-format -yc conda-forge
RUN conda install -y tensorflow keras
RUN conda install pytorch torchvision -c pytorch
RUN pytorch-cpu torchvision-cpu -c pytorch
RUN conda install -y JSAnimation
RUN apt-get update && apt-get install -y graphviz xvfb python-opengl swig
@@ -35,6 +35,8 @@ RUN pip install gym box2d
RUN conda clean --yes --tarballs --packages --source-cache
COPY jupyter_notebook_config.py /root/.jupyter/
VOLUME /notebook
WORKDIR /notebook
EXPOSE 8888
View
@@ -0,0 +1,17 @@
import os
from IPython.lib import passwd
c = c # pylint:disable=undefined-variable
c.NotebookApp.ip = '*'
c.NotebookApp.port = int(os.getenv('PORT', 8888))
c.NotebookApp.open_browser = False
# sets a password if PASSWORD is set in the environment
if 'PASSWORD' in os.environ:
password = os.environ['PASSWORD']
if password:
c.NotebookApp.password = passwd(password)
else:
c.NotebookApp.password = ''
c.NotebookApp.token = ''
del os.environ['PASSWORD']

0 comments on commit 61cd26e

Please sign in to comment.