forked from FAU-DLM/GPU-Jupyterhub
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
98 lines (87 loc) · 3.42 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# JupyterHub docker-compose configuration file
version: "2.3"
services:
hub:
depends_on:
- hub-db
build:
context: .
dockerfile: Dockerfile.jupyterhub
args:
JUPYTERHUB_VERSION: ${JUPYTERHUB_VERSION}
restart: always
image: jupyterhub
runtime: nvidia
container_name: jupyterhub
volumes:
# use a volume mapping into the container if you like
- "/notebook_dir:${DOCKER_NOTEBOOK_DIR}"
# 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
- "data:${DATA_VOLUME_CONTAINER}"
# and now a place for all your giant ML data---change to suit your install
- "/path/to/data:/ml_data"
ports:
- "443:443"
links:
- hub-db
environment:
# this is just to show how to use with self signed keys use which ever you like
SSL_KEY: ${SSL_KEY}
SSL_CERT: ${SSL_CERT}
# All containers will join this network
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
# JupyterHub will spawn this Notebook image for users
DOCKER_NOTEBOOK_IMAGE: ${LOCAL_NOTEBOOK_IMAGE}
# Notebook directory inside user image
DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
# data dir inside the user image
DOCKER_SHARED_DATA_DIR: ${DOCKER_SHARED_DATA_DIR}
# Using this run command (optional)
DOCKER_SPAWN_CMD: ${DOCKER_SPAWN_CMD}
CONFIGPROXY_AUTH_TOKEN: ${CONFIGPROXY_AUTH_TOKEN}
## needed for nvidia-docker version 2
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: compute,utility
# Postgres db info
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: hub-db
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
command: >
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
# postgres database
hub-db:
image: postgres:9.5
container_name: jupyterhub-db
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DB}
PGDATA: ${DB_VOLUME_CONTAINER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# I have the postgres related settings stored in the .env file but you could store them here or in a docker volume using dockersecrets
#env_file:
#- secrets/postgres.env
volumes:
- "db:${DB_VOLUME_CONTAINER}"
#PHP-Adminer
adminer:
links:
- hub-db
image: clue/adminer:latest
ports:
- 7000:80
networks:
default:
external:
name: ${DOCKER_NETWORK_NAME} ## need to be created first IE `docker network create $NETWORK_NAME`
volumes:
data:
external:
name: ${DATA_VOLUME_HOST} ## need to be created first IE `docker volume create --name=$VOLUME_NAME`
db:
external:
name: ${DB_VOLUME_HOST} ## need to be created first IE `docker volume create --name=$VOLUME_NAME`