zipline/etc/docker_cmd.sh
2016-05-16 17:07:03 -04:00

19 lines
665 B
Bash
Executable file

#!/bin/bash
#
# generate configuration, cert, and password if this is the first run
#
if [ ! -f /var/tmp/zipline_init ] ; then
jupyter notebook --generate-config
if [ ! -f ${SSL_CERT_PEM} ] ; then
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=127.0.0.1" \
-keyout ${SSL_CERT_KEY} -out ${SSL_CERT_PEM}
fi
echo "c.NotebookApp.password = ${PW_HASH}" >> ${CONFIG_PATH}
touch /var/tmp/zipline_init
fi
jupyter notebook -y --no-browser --notebook-dir=${PROJECT_DIR} \
--certfile=${SSL_CERT_PEM} --keyfile=${SSL_CERT_KEY} --ip='*' \
--config=${CONFIG_PATH}