jupyterhub-deploy-docker/docker-compose.yml
mathematicalmichael c01aa8af68 updated templating.
2019-01-11 14:47:21 -07:00

72 lines
1.8 KiB
YAML
Executable File

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# JupyterHub docker-compose configuration file
version: "3"
services:
hub-db:
image: postgres:9.5
container_name: ${HUB_NAME}-db
restart: always
environment:
POSTGRES_DB: ${HUB_NAME}
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: ${JUPYTERHUB_VERSION}
restart: always
image: ${HUB_NAME}
container_name: ${HUB_NAME}
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"
- "./jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py"
- "./userlist:/srv/jupyterhub/userlist"
- "/home/math/:/home/"
ports:
- "${PORT_NUM}:8000"
links:
- hub-db
environment:
#HUB_NAME: ${HUB_NAME}
# Notebook directory inside user image
#DOCKER_NOTEBOOK_DIR: ${DOCKER_NOTEBOOK_DIR}
# Using this run command (optional)
#DOCKER_SPAWN_CMD: ${DOCKER_SPAWN_CMD}
# Postgres db info
POSTGRES_DB: ${HUB_NAME}
POSTGRES_HOST: hub-db
env_file:
- secrets/postgres.env
- secrets/oauth.env
- .env
command: >
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
volumes:
data:
external:
name: ${HUB_NAME}-data
db:
external:
name: ${HUB_NAME}-db-data
networks:
default:
external:
name: ${HUB_NAME}-network