Skip to content

Commit

Permalink
Merge pull request #30 from ContactEngineering/2023-09-23-custom-docs
Browse files Browse the repository at this point in the history
2023 09 23 custom docs
  • Loading branch information
jotelha committed Sep 23, 2023
2 parents 8003e9b + 40ce3b1 commit 966715f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
27 changes: 18 additions & 9 deletions docker/jupyterlab-SurfaceTopography/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand All @@ -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 && \
Expand Down Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions docker/jupyterlab-SurfaceTopography/conda-requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
jupyterlab_autorun_cells
jupytext
jupyterlab-tour
jupyter-app-launcher
md2nb
Original file line number Diff line number Diff line change
@@ -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']

0 comments on commit 966715f

Please sign in to comment.