From d99a4eb501192607488a3e8f9e10d6447c48d357 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 21 Oct 2021 03:54:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Move=20the=20jupyter=20Dockerfil?= =?UTF-8?q?e=20here?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docker-images.yml | 12 ++++++++++ jupyter/Dockerfile | 27 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 jupyter/Dockerfile diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index 3f64fc8..2f064e8 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -39,3 +39,15 @@ jobs: run: docker build ./proxy --tag ghcr.io/steffo99/sophon-proxy:latest - name: "Upload the container to GitHub Containers" run: docker push ghcr.io/steffo99/sophon-proxy:latest + build-jupyter: + name: "Build jupyter image" + runs-on: ubuntu-latest + steps: + - name: "Checkout repository" + uses: actions/checkout@v2 + - name: "Login to GitHub Containers" + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u Steffo99 --password-stdin + - name: "Build the docker container `ghcr.io/steffo99/sophon-jupyter:latest`" + run: docker build ./jupyter --tag ghcr.io/steffo99/sophon-jupyter:latest + - name: "Upload the container to GitHub Containers" + run: docker push ghcr.io/steffo99/sophon-jupyter:latest diff --git a/jupyter/Dockerfile b/jupyter/Dockerfile new file mode 100644 index 0000000..50bdf31 --- /dev/null +++ b/jupyter/Dockerfile @@ -0,0 +1,27 @@ +# Modified jupyter/scipy-notebook for better integration with Sophon + +# Override the default "jovyan" user +ARG NB_USER="sophon" + +# Set the base image of the notebook +FROM jupyter/scipy-notebook + +# Image labels +LABEL maintainer="Stefano Pigozzi " + +# 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 +RUN jupyter labextension enable "jupyter_theme_sophon" +# 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" + +# Set useful envvars for Sophon notebooks +ENV JUPYTER_ENABLE_LAB=yes +ENV RESTARTABLE=yes +ENV GRANT_SUDO=yes