-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-stack.yml
68 lines (64 loc) · 1.79 KB
/
docker-compose-stack.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
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# JupyterHub docker-compose configuration file
version: '3.1'
services:
hub-db:
image: postgres:9.5
container_name: jupyterhub-db
restart: always
environment:
POSTGRES_DB: jupyterhub
PGDATA: /var/lib/postgresql/data
env_file:
- secrets/postgres.env
volumes:
- "db:/var/lib/postgresql/data"
hub:
depends_on:
- hub-db
build:
context: .
dockerfile: Dockerfile.jupyterhub
args:
JUPYTERHUB_VERSION: 0.8.0
restart: always
image: jupyterhub
container_name: jupyterhub
volumes:
# 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"
- "/etc/shadow:/etc/shadow"
- "/etc/passwd:/etc/passwd"
- "/etc/pam.d:/etc/pam.d"
ports:
- "443:443"
links:
- hub-db
environment:
# All containers will join this network
DOCKER_NETWORK_NAME: jupyterhub_default
# JupyterHub will spawn this Notebook image for users
DOCKER_NOTEBOOK_IMAGE: datalab195/base_notebook
# Notebook directory inside user image
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
# Using this run command (optional)
DOCKER_SPAWN_CMD: "start-notebook.sh"
# Postgres db info
POSTGRES_DB: jupyterhub
POSTGRES_HOST: hub-db
env_file:
- secrets/postgres.env
- secrets/oauth.env
command: >
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
volumes:
data:
external:
name: jupyterhub-data
db:
external:
name: jupyterhub-db-data