Files
docker-stacks/base-notebook/start-notebook.sh
Jeff a667552e78 Option to enable restart without exiting container
Add optional environment variable RESTARTABLE to enable Jupyter to
be restarted without causing the container to exit.  When the variable
is set, run-one-constantly (from the Ubuntu run-one package) is
inserted into the Jupyter startup command.
2019-08-02 11:17:04 -06:00

20 lines
524 B
Bash
Executable File

#!/bin/bash
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
set -e
wrapper=""
if [[ "${RESTARTABLE}" == "yes" ]]; then
wrapper="run-one-constantly"
fi
if [[ ! -z "${JUPYTERHUB_API_TOKEN}" ]]; then
# launched by JupyterHub, use single-user entrypoint
exec /usr/local/bin/start-singleuser.sh "$@"
elif [[ ! -z "${JUPYTER_ENABLE_LAB}" ]]; then
. /usr/local/bin/start.sh $wrapper jupyter lab "$@"
else
. /usr/local/bin/start.sh $wrapper jupyter notebook "$@"
fi