-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
81 lines (77 loc) · 2.58 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# JupyterHub docker-compose configuration file
services:
hub:
build:
context: .
dockerfile: Dockerfile.jupyterhub
args:
JUPYTERHUB_VERSION: 5.2.1
restart: always
image: jupyterhub
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
container_name: jupyterhub
networks:
- jupyterhub-network
depends_on:
- hub-db
volumes:
# The JupyterHub configuration file
- "./jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py:ro"
# Bind Docker socket on the host so we can connect to the daemon from
# within the container
- "/var/run/docker.sock:/var/run/docker.sock:rw"
# Bind Docker volume on host for JupyterHub database and cookie secrets
- "jupyterhub-data:/data"
- "${HOST_PERSONAL_NETWORK_FOLDER}:${DOCKER_PERSONAL_NETWORK_FOLDER}" ### needed for pre spawn hook
- "${HOST_SHARED_NETWORK_FOLDER}:${DOCKER_SHARED_NETWORK_FOLDER}" ### not really needed
ports:
- "8000:8000"
environment:
# This username will be a JupyterHub admin
JUPYTERHUB_ADMIN: admin
# All containers will join this network
DOCKER_NETWORK_NAME: jupyterhub-network
# JupyterHub will spawn this Notebook image for users
DOCKER_NOTEBOOK_IMAGE: quay.io/jupyter/pytorch-notebook:cuda12-notebook-7.2.2
# Notebook directory inside user image
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
# Enable NVIDIA GPU support
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: compute,utility
#Network paths
DOCKER_PERSONAL_NETWORK_FOLDER: ${DOCKER_PERSONAL_NETWORK_FOLDER}
HOST_PERSONAL_NETWORK_FOLDER: ${HOST_PERSONAL_NETWORK_FOLDER}
DOCKER_SHARED_NETWORK_FOLDER: ${DOCKER_SHARED_NETWORK_FOLDER}
HOST_SHARED_NETWORK_FOLDER: ${HOST_SHARED_NETWORK_FOLDER}
# Postgres DB info
POSTGRES_HOST: hub-db
POSTGRES_DB: ${POSTGRES_DB}
PGPASSWORD: ${PGPASSWORD}
PGUSER: ${PGUSER}
command: >
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
hub-db:
image: postgres:17
container_name: jupyterhub-db
restart: unless-stopped
environment:
PGDATA: /data/pgdata
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PASSWORD: ${PGPASSWORD}
POSTGRES_USER: ${PGUSER}
volumes:
- "postgres:/data/pgdata"
networks:
- jupyterhub-network
volumes:
jupyterhub-data:
postgres:
networks:
jupyterhub-network:
name: jupyterhub-network