fix: JupyterHub Dockerfile - add eric user, sudo, fix DB path (4 slashes)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user