1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-10-16 07:07:26 +00:00
sophon/jupyter/Dockerfile

41 lines
1.2 KiB
Docker
Raw Permalink Normal View History

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
# 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-30 12:29:49 +00:00
# Enable real time collaboration
CMD ["start-notebook.sh", "--collaborative"]
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}