Skip to content

Commit

Permalink
ENH: Custom README accessible as ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
jotelha committed Sep 23, 2023
1 parent 8663ae5 commit 40ce3b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
16 changes: 9 additions & 7 deletions docker/jupyterlab-SurfaceTopography/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ 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 @@ -73,5 +73,7 @@ COPY --chown=${NB_UID}:${NB_GID} jupyterlab-SurfaceTopography/etc/jupyter_app_la

# 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"]
2 changes: 1 addition & 1 deletion docker/jupyterlab-SurfaceTopography/conda-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ jupyterlab_autorun_cells
jupytext
jupyterlab-tour
jupyter-app-launcher

md2nb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
- title: README
description: jupyterlab-SurfaceTopography container README.md
source: ../../README.md
type: markdown
description: jupyterlab-SurfaceTopography container README
source: ../../README.ipynb
cwd: ../../
type: notebook
catalog: Help

- title: SurfaceTopography docs
Expand Down

0 comments on commit 40ce3b1

Please sign in to comment.