From dd2d493272d1b528c99878a9b5aed2be1a68a4e5 Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Mon, 23 Sep 2024 16:23:42 +0200 Subject: [PATCH] Add jupyterhub compose file and Dockerfile --- README.md | 4 ++++ jupyterhub/Dockerfile | 23 +++++++++++++++++++++++ jupyterhub/compose.yaml | 10 ++++++++++ 3 files changed, 37 insertions(+) create mode 100644 jupyterhub/Dockerfile create mode 100644 jupyterhub/compose.yaml diff --git a/README.md b/README.md index debab75..b691563 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,7 @@ Nothing to do here ## Searxng Make volume paths relative + +## Jupyterhub + +Simple jupyterhub setup. Allows for passwordless login of users set in Dockerfile. diff --git a/jupyterhub/Dockerfile b/jupyterhub/Dockerfile new file mode 100644 index 0000000..24083ca --- /dev/null +++ b/jupyterhub/Dockerfile @@ -0,0 +1,23 @@ +FROM quay.io/jupyterhub/jupyterhub:latest + +RUN useradd -m fabian +RUN useradd -m amour +RUN passwd -d fabian +RUN passwd -d amour + +RUN pip install notebook + +WORKDIR /data + +RUN echo '#!/bin/sh \n\ +\n\ +echo "c = get_config()" >> /srv/jupyterhub/jupyterhub_config.py \n\ +echo "c.Authenticator.allow_all = True" >> /srv/jupyterhub/jupyterhub_config.py \n\ +\n\ +exec jupyterhub -f /srv/jupyterhub/jupyterhub_config.py \n\ +' >> /data/run.sh + +RUN chmod +x /data/run.sh + + +CMD ["/data/run.sh"] diff --git a/jupyterhub/compose.yaml b/jupyterhub/compose.yaml new file mode 100644 index 0000000..248c852 --- /dev/null +++ b/jupyterhub/compose.yaml @@ -0,0 +1,10 @@ +services: + jupyterhub: + build: . + image: jupyterhub + container_name: jupyterhub + volumes: + - ./data:/srv/jupyterhub + ports: + - 8050:8000 + restart: always