2021-10-21 01:54:04 +00:00
|
|
|
# Modified jupyter/scipy-notebook for better integration with Sophon
|
|
|
|
|
2021-11-01 03:10:50 +00:00
|
|
|
FROM jupyter/scipy-notebook AS base
|
|
|
|
# Set the maintainer label
|
|
|
|
LABEL maintainer="Stefano Pigozzi <me@steffo.eu>"
|
|
|
|
|
|
|
|
|
|
|
|
FROM base AS env
|
2021-10-21 01:54:04 +00:00
|
|
|
# Override the default "jovyan" user
|
|
|
|
ARG NB_USER="sophon"
|
2021-11-01 03:10:50 +00:00
|
|
|
# Set useful envvars for Sophon notebooks
|
|
|
|
ENV JUPYTER_ENABLE_LAB=yes
|
|
|
|
ENV RESTARTABLE=yes
|
|
|
|
ENV GRANT_SUDO=yes
|
2021-10-21 01:54:04 +00:00
|
|
|
|
|
|
|
|
2021-11-01 03:10:50 +00:00
|
|
|
FROM env AS extensions
|
2021-10-21 01:54:04 +00:00
|
|
|
# As the default user...
|
|
|
|
USER ${NB_UID}
|
|
|
|
WORKDIR "${HOME}"
|
|
|
|
# Install the JupyterLab Sophon theme
|
|
|
|
RUN jupyter labextension install "jupyterlab_theme_sophon"
|
|
|
|
# Enable the JupyterLab Sophon theme
|
2021-11-01 03:10:50 +00:00
|
|
|
RUN jupyter labextension enable "jupyterlab_theme_sophon"
|
2021-10-21 01:54:04 +00:00
|
|
|
# Set the JupyterLab Sophon theme as default
|
|
|
|
RUN mkdir -p '.jupyter/lab/user-settings/@jupyterlab/apputils-extension/'
|
|
|
|
RUN echo '{"theme": "JupyterLab Sophon"}' > ".jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings"
|
|
|
|
|
2021-11-01 03:10:50 +00:00
|
|
|
|
|
|
|
FROM extensions AS healthcheck
|
|
|
|
# As root...
|
|
|
|
USER root
|
2021-11-04 03:08:07 +00:00
|
|
|
# Install curl
|
2021-11-01 03:10:50 +00:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y curl
|
|
|
|
# Use curl to check the health status
|
|
|
|
HEALTHCHECK --start-period=5s --timeout=5s --interval=10s CMD ["curl", "--output", "/dev/null", "http://localhost:8888"]
|
|
|
|
|
|
|
|
# We probably should go back to the default user
|
|
|
|
USER ${NB_UID}
|