Revert to using supervisord to launch notebook

Used to relaunch notebook and collect logging data.
This commit is contained in:
Carl Osterwisch
2015-08-28 10:43:32 -04:00
committed by Peter Parente
parent f2b7f38df6
commit 30932a3b12
3 changed files with 14 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
texlive-latex-extra \
texlive-fonts-extra \
texlive-fonts-recommended \
supervisor \
sudo \
&& apt-get clean
@@ -53,4 +54,5 @@ CMD [ "start-notebook.sh" ]
# Add local files as late as possible to avoid cache busting
COPY start-notebook.sh /usr/local/bin/
COPY notebook.conf /etc/supervisor/conf.d/
COPY jupyter_notebook_config.py /etc/skel/.jupyter/

View File

@@ -0,0 +1,10 @@
[program:notebook]
user=jovyan
umask=0002
directory=%(ENV_WORK)s
command=ipython notebook
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log
redirect_stderr=true
environment=HOME="/home/%(ENV_NB_USER)s",USER="%(ENV_NB_USER)s"

View File

@@ -12,8 +12,5 @@ if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi
# Run Notebook server as $NB_USER
su -l $NB_USER << EOF
cd $WORK
jupyter notebook
EOF
# Start supervisord in foreground, PID1
exec supervisord -n -c /etc/supervisor/supervisord.conf