-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_jupyter
executable file
·27 lines (21 loc) · 1.02 KB
/
start_jupyter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
echo "Starting pgcontents initialization"
echo "DATABASE_URL is $DATABASE_URL"
pgcontents init --no-prompt -l ${DATABASE_URL/postgres:/postgresql:} || exit 1
echo "pgcontents initialized"
echo "Installing Jupyter extensions"
jupyter contrib nbextension install --user
echo "Extensions installed"
echo "Enabling nbextensions configurator"
jupyter nbextensions_configurator enable --user
echo "Nbextensions configurator enabled"
# heroku will override $PS1 when specified as a config var, so we'll set it here to make the jupyter
# terminal interface a little prettier:
export PS1='\[\033[01;34m\]\w\[\033[00m\]\$'
echo "Starting Jupyter ${JUPYTER_NOTEBOOK_OR_LAB}"
# NOTE: With allow_origin='*', anyone with the URL and password can potentially access your notebook,
# so be careful w/ the URL and password. Don't put sensitive data up here.
jupyter $JUPYTER_NOTEBOOK_OR_LAB \
--no-browser --ip=0.0.0.0 --port=$PORT \
--ServerApp.allow_origin='*' --ServerApp.allow_credentials=True \
$JUPYTER_NOTEBOOK_ARGS \