fix: JupyterHub Dockerfile - add eric user, sudo, fix DB path (4 slashes)

This commit is contained in:
Eric FELIXINE
2026-06-01 10:26:47 -04:00
parent 9e933fea66
commit cb45b89f1f
16 changed files with 828 additions and 15 deletions

View File

@@ -3,7 +3,7 @@ FROM jupyterhub/jupyterhub:5.3.0
USER root
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends git sudo && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir \
git+https://github.com/jupyterhub/nativeauthenticator.git@main \
@@ -12,9 +12,17 @@ RUN pip install --no-cache-dir \
jupyterlab \
notebook
# Create eric user with password-less sudo
RUN useradd -m -s /bin/bash -u 1000 eric && \
echo "eric ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
chown -R eric:eric /home/eric
# Create the directory for JupyterHub data
RUN mkdir -p /srv/jupyterhub && chown -R 1000:1000 /srv/jupyterhub
ARG BUILD_DATE=unknown
RUN echo "Build date: ${BUILD_DATE}" > /tmp/build-info.txt
COPY jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py
WORKDIR /srv/jupyterhub

View File

@@ -1,4 +1,8 @@
# JupyterHub configuration for Smart City VRE
# Uses NativeAuthenticator with LocalProcessSpawner
# Build: 2026-06-01-0915
import sys as _sys
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.port = 8000
@@ -9,14 +13,14 @@ c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'
c.Authenticator.admin_users = {'admin'}
c.Authenticator.allow_all = True
# Spawner — use SimpleLocalProcessSpawner (default in JupyterHub 5.x)
# This spawner runs singleuser servers as subprocesses
c.JupyterHub.spawner_class = 'jupyterhub.spawner.SimpleLocalProcessSpawner'
# Spawner: Simple local spawner (single-node, shared environment)
c.JupyterHub.spawner_class = 'simple'
c.Spawner.cmd = ['jupyterhub-singleuser']
c.Spawner.default_url = '/lab'
c.Spawner.http_timeout = 300
c.Spawner.start_timeout = 300
c.Spawner.http_timeout = 120
# Database and cookies - use absolute paths
# Database and cookies - use absolute path (4 slashes!)
c.JupyterHub.cookie_secret_file = '/srv/jupyterhub/jupyterhub_cookie_secret'
c.JupyterHub.db_url = 'sqlite:////srv/jupyterhub/jupyterhub.sqlite'