-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yaml
55 lines (49 loc) · 1.75 KB
/
docker-compose.yaml
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
version: "3.8"
# usage: `docker compose up` or `docker compose up --detach`
services:
notebook-image:
build:
context: .
dockerfile: notebook.Dockerfile
args:
FORK: ${FORK:-vyperlang}
REF: ${REF:-master}
image: ${NOTEBOOK_IMAGE_NAME:-titanoboa-notebook}
command: ["echo", "This image is started by Jupyter"]
vypyter:
build:
context: .
dockerfile: jupyterhub.Dockerfile
depends_on:
- notebook-image
restart: always
volumes:
# The JupyterHub configuration file
- "./config/jupyterhub_config.py:/etc/jupyterhub/jupyterhub_config.py:ro"
# Bind Docker socket on the host for docker-in-docker
- "/var/run/docker.sock:/var/run/docker.sock:rw"
# Bind Docker volume on host for JupyterHub database and cookie secrets
- "./data:/data"
image: ${JUPYTERHUB_IMAGE_NAME:-jupyterhub}
# for child processes to connect to
container_name: ${JUPYTERHUB_IMAGE_NAME:-jupyterhub}
networks:
- jupyterhub-network
ports:
- "${PORT:-8000}:8000"
env_file: .env
environment:
# Pass its own IP for the notebooks to connect to
HUB_CONNECT_IP: ${JUPYTERHUB_IMAGE_NAME:-jupyterhub}
# All containers will join this network
DOCKER_NETWORK_NAME: ${JUPYTERHUB_IMAGE_NAME:-jupyterhub}-network
# JupyterHub will spawn this Notebook image for users
DOCKER_NOTEBOOK_IMAGE: ${NOTEBOOK_IMAGE_NAME:-titanoboa-notebook}
# Using this run command
DOCKER_SPAWN_CMD: start-singleuser.sh
# weird things happen when nesting docker containers
# pass the directory on the host to mount on the inner container
PWD: "${PWD}"
networks:
jupyterhub-network:
name: ${JUPYTERHUB_IMAGE_NAME:-jupyterhub}-network