diff --git a/jupyter-vadc/Dockerfile b/jupyter-vadc/Dockerfile new file mode 100644 index 00000000..4e9e9f4b --- /dev/null +++ b/jupyter-vadc/Dockerfile @@ -0,0 +1,21 @@ +FROM quay.io/cdis/datascience-notebook:notebook-6.4.8 +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + freetds-bin \ + && rm -rf /var/lib/apt/lists/* + +USER ${NB_UID} + +# install extra packages +RUN mamba install --quiet --yes \ + 'pymssql' && \ + mamba clean --all -f -y && \ + fix-permissions "${CONDA_DIR}" && \ + fix-permissions "/home/${NB_USER}" + +WORKDIR /home/${NB_USER} + +COPY --chown=jovyan:users resources/custom.js /home/${NB_USER}/.jupyter/custom/ +COPY --chown=jovyan:users resources/jupyter_notebook_config.py /home/${NB_USER}/.jupyter/ diff --git a/jupyter-vadc/resources/custom.js b/jupyter-vadc/resources/custom.js new file mode 100644 index 00000000..c670b1f1 --- /dev/null +++ b/jupyter-vadc/resources/custom.js @@ -0,0 +1,4 @@ +// do not open notebooks in a new tab: https://github.com/jupyter/notebook/issues/4115 +define(['base/js/namespace'], function(Jupyter){ + Jupyter._target = '_self'; +}) diff --git a/jupyter-vadc/resources/jupyter_notebook_config.py b/jupyter-vadc/resources/jupyter_notebook_config.py new file mode 100644 index 00000000..a8825600 --- /dev/null +++ b/jupyter-vadc/resources/jupyter_notebook_config.py @@ -0,0 +1,8 @@ +import os + +c.NotebookApp.tornado_settings = { + "headers": { + "Content-Security-Policy": "frame-ancestors self %s" + % os.getenv("FRAME_ANCESTORS", "") + } +}