diff --git a/docker/jupyterlab-SurfaceTopography/Dockerfile b/docker/jupyterlab-SurfaceTopography/Dockerfile index 27624eb..02d1de5 100644 --- a/docker/jupyterlab-SurfaceTopography/Dockerfile +++ b/docker/jupyterlab-SurfaceTopography/Dockerfile @@ -1,17 +1,10 @@ # Build from within repository root # # Modify conda enviornment running jupyter notebooks -FROM jupyter/minimal-notebook:latest +FROM jupyter/minimal-notebook:python-3.11.5 USER root -COPY --chown=${NB_UID}:${NB_GID} jupyterlab-SurfaceTopography/conda-requirements.in "/home/${NB_USER}/" -RUN pip install pip-tools -RUN pip-compile "/home/${NB_USER}/conda-requirements.in" > "/home/${NB_USER}/conda-requirements.txt" -RUN pip install --quiet --no-cache-dir --requirement "/home/${NB_USER}/conda-requirements.txt" && \ - fix-permissions "${CONDA_DIR}" && \ - fix-permissions "/home/${NB_USER}" - # FROM imkteksim/dtool-jupyter:latest # Install from requirements.txt file RUN apt-get --yes update && \ @@ -31,6 +24,13 @@ RUN apt-get --yes update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +COPY --chown=${NB_UID}:${NB_GID} jupyterlab-SurfaceTopography/conda-requirements.in "/home/${NB_USER}/" +RUN pip install pip-tools +RUN pip-compile "/home/${NB_USER}/conda-requirements.in" > "/home/${NB_USER}/conda-requirements.txt" +RUN pip install --quiet --no-cache-dir --requirement "/home/${NB_USER}/conda-requirements.txt" && \ + fix-permissions "${CONDA_DIR}" && \ + fix-permissions "/home/${NB_USER}" + # Workaround for building packages and introducing an ipykernel outside of the jupyterlab conda environment RUN PATH=$(echo "$PATH" | sed -e 's|/opt/conda[^:]*:||g') && ( \ pip install meson ninja && \ @@ -60,11 +60,20 @@ RUN apt-get --yes update && \ WORKDIR /home/${NB_USER}/work USER ${NB_UID} -# Remove annyoing conda environment from terminal sessions +# Remove annoying conda environment from terminal sessions RUN echo "conda deactivate" >> "${HOME}/.bashrc" RUN echo 'export PATH=$(echo "$PATH" | sed -e '"'"'s|/opt/conda[^:]*:||g'"'"')' >> "${HOME}/.bashrc" # Set default kernel RUN echo "c.MultiKernelManager.default_kernel_name = 'surfacetopography'" >> "${HOME}/.jupyter/jupyter_server_config.py" +# Copy jupyter-app-launcher configuration +ENV JUPYTER_APP_LAUNCHER_PATH="/home/${NB_USER}/.jupyter/jupyter_app_launcher" +COPY --chown=${NB_UID}:${NB_GID} jupyterlab-SurfaceTopography/etc/jupyter_app_launcher "/home/${NB_USER}/.jupyter/jupyter_app_launcher" + +# Copy README.md +COPY --chown=${NB_UID}:${NB_GID} jupyterlab-SurfaceTopography/README.md "/home/${NB_USER}/README.md" +RUN pandoc "/home/${NB_USER}/README.md" -o "/home/${NB_USER}/README.html" +RUN md2nb "/home/${NB_USER}/README.md" + CMD ["start-wrapper.sh", "start-notebook.sh"] diff --git a/docker/jupyterlab-SurfaceTopography/conda-requirements.in b/docker/jupyterlab-SurfaceTopography/conda-requirements.in index b8384fb..f33b512 100644 --- a/docker/jupyterlab-SurfaceTopography/conda-requirements.in +++ b/docker/jupyterlab-SurfaceTopography/conda-requirements.in @@ -1,2 +1,5 @@ jupyterlab_autorun_cells jupytext +jupyterlab-tour +jupyter-app-launcher +md2nb diff --git a/docker/jupyterlab-SurfaceTopography/etc/jupyter_app_launcher/config.yaml b/docker/jupyterlab-SurfaceTopography/etc/jupyter_app_launcher/config.yaml new file mode 100644 index 0000000..c420c42 --- /dev/null +++ b/docker/jupyterlab-SurfaceTopography/etc/jupyter_app_launcher/config.yaml @@ -0,0 +1,14 @@ +- title: README + description: jupyterlab-SurfaceTopography container README + source: ../../README.ipynb + cwd: ../../ + type: notebook + catalog: Help + +- title: SurfaceTopography docs + description: SurfaceTopography documentation + source: https://contactengineering.github.io/SurfaceTopography/ + type: url + catalog: Help + args: + sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']