From 2d2467ea0b7dec55d2419afb5218190a84ea987c Mon Sep 17 00:00:00 2001 From: Tim Metzler <33530562+tmetzl@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:32:58 +0100 Subject: [PATCH] Make smaller exam notebook --- exam-notebook/Dockerfile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/exam-notebook/Dockerfile b/exam-notebook/Dockerfile index 07d30bb..8232ec6 100644 --- a/exam-notebook/Dockerfile +++ b/exam-notebook/Dockerfile @@ -1,8 +1,29 @@ -ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/notebook:latest +ARG IMAGE_SOURCE=ghcr.io/digiklausur/docker-stacks/minimal-notebook:latest FROM $IMAGE_SOURCE LABEL maintainer="e2x project H-BRS " +USER root +# Copy nbgrader base config +COPY configs/nbgrader_config.py /etc/jupyter/nbgrader_config.py +RUN chown root:$NB_GID /etc/jupyter/nbgrader_config.py &&\ + chmod g+rwX /etc/jupyter/nbgrader_config.py + +USER $NB_USER + +# Install grading requirements +COPY requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt && \ + pip install --no-cache-dir e2xgrader=="0.3.0-dev2" + +# Set up kernels +RUN touch /etc/ipython/ipython_config.py && \ + python -m exam_kernel.install --sys-prefix && \ + python -m java_syntax_kernel.install --sys-prefix + +USER root +RUN rm /tmp/requirements.txt + USER $NB_USER # Activate student exam mode by default