Files
OBIJupyterHub/obijupyterhub/docker-compose.yml

121 lines
3.1 KiB
YAML
Raw Permalink Normal View History

2025-10-14 17:40:41 +02:00
services:
jupyterhub:
build:
context: .
dockerfile: Dockerfile.hub
container_name: jupyterhub
2025-10-15 15:55:43 +02:00
hostname: jupyterhub
2025-10-14 17:40:41 +02:00
image: jupyterhub-hub:latest
2025-10-15 15:55:43 +02:00
expose:
- "8000"
2025-10-14 17:40:41 +02:00
volumes:
2025-10-15 07:10:44 +02:00
# Access to Docker socket to spawn student containers
2025-10-14 17:40:41 +02:00
- /var/run/docker.sock:/var/run/docker.sock
2025-10-15 07:10:44 +02:00
# JupyterHub database persistence
2025-10-16 01:07:07 +02:00
- data:/srv/jupyterhub
2025-11-05 17:29:12 +01:00
# Mount the parent volumes directory to access users/, shared/, course/
- ../jupyterhub_volumes:/volumes
2025-10-15 07:10:44 +02:00
# Mount config file directly (for easy modifications)
2025-10-14 17:40:41 +02:00
- ./jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py:ro
networks:
- jupyterhub-network
restart: unless-stopped
environment:
2025-10-15 07:10:44 +02:00
# Shared password for all students
2025-10-14 17:40:41 +02:00
JUPYTERHUB_PASSWORD: metabar2025
2025-10-15 07:15:05 +02:00
# Admin password (for installing R packages)
JUPYTERHUB_ADMIN_PASSWORD: admin2025
2025-10-15 07:10:44 +02:00
# Optional environment variables
2025-10-14 17:40:41 +02:00
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
2025-11-05 17:29:12 +01:00
# Use PWD to get absolute path relative to docker-compose.yml location
HOST_VOLUMES_PATH: ${PWD}/../jupyterhub_volumes
2025-10-14 17:40:41 +02:00
2025-10-15 15:55:43 +02:00
# ---------- Nginx ----------
caddy:
container_name: jupyterhub-caddy
hostname: jupytercaddy
image: caddy:latest
ports:
- "8888:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
2025-10-16 01:07:07 +02:00
- caddy-data:/data
- caddy-config:/config
- web:/srv # Votre app
2025-10-15 15:55:43 +02:00
networks:
- jupyterhub-network
restart: unless-stopped
# ---------- SFTPGo ----------
sftpgo:
image: drakkan/sftpgo:latest
container_name: jupyterhub-sftpgo
hostname: jupytersftp
command: sftpgo serve --loaddata-from /config/local_config.json --loaddata-clean
expose:
- "2022"
- "8080"
environment:
SFTPGO_DATA_PROVIDER__CREATE_DEFAULT_ADMIN: true
SFTPGO_DEFAULT_ADMIN_USERNAME: admin
SFTPGO_DEFAULT_ADMIN_PASSWORD: admin2025
SFTPGO_HTTPD__BINDINGS__0__CLIENT_IP_PROXY_HEADER: X-Real-IP
volumes:
2025-10-16 01:07:07 +02:00
- shared:/volumes/shared
- course:/volumes/course
- web:/volumes/web
2025-10-15 15:55:43 +02:00
- ./sftpgo_config.json:/config/local_config.json:ro
networks:
- jupyterhub-network
restart: unless-stopped
2025-10-14 17:40:41 +02:00
networks:
jupyterhub-network:
name: jupyterhub-network
driver: bridge
volumes:
2025-10-16 01:07:07 +02:00
data:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/jupyterhub
shared:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/shared
course:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/course
web:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/web
caddy-data:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/caddy/data
caddy-config:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/caddy/config
users:
2025-10-15 15:55:43 +02:00
driver: local
driver_opts:
type: none
o: bind
2025-10-16 01:07:07 +02:00
device: ../jupyterhub_volumes/users