version: "3.9" services: jupyterhub: build: context: . dockerfile: Dockerfile image: smartcity-jupyterhub:latest container_name: jupyterhub restart: unless-stopped networks: - smartcity-shared # Run as root to avoid UID issues, JupyterHub will drop privs user: root environment: - JUPYTERHUB_CRYPT_KEY=a1b2c3d4-e5f6-7890-abcd-ef1234567890 volumes: - jupyterhub_data:/srv/jupyterhub labels: - "traefik.enable=true" - "traefik.http.routers.jupyterhub.rule=Host(`jupyter.digitribe.fr`)" - "traefik.http.routers.jupyterhub.entrypoints=websecure" - "traefik.http.routers.jupyterhub.tls.certresolver=letsencrypt" - "traefik.http.routers.jupyterhub.service=jupyterhub-svc" - "traefik.http.services.jupyterhub-svc.loadbalancer.server.port=8000" - "traefik.http.services.jupyterhub-svc.loadbalancer.passhostheader=true" - "traefik.docker.network=smartcity-shared" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/hub/health"] interval: 30s timeout: 10s retries: 5 start_period: 30s networks: smartcity-shared: external: true volumes: jupyterhub_data: driver: local