62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
# Copyright (c) Jupyter Development Team.
|
|
# Distributed under the terms of the Modified BSD License.
|
|
|
|
# JupyterHub docker compose configuration file
|
|
version: "3"
|
|
|
|
services:
|
|
hub:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.jupyterhub
|
|
args:
|
|
JUPYTERHUB_VERSION: latest
|
|
restart: always
|
|
image: hotwa/jupyterhub # registry.cn-hangzhou.aliyuncs.com/hotwa/jupyterhub
|
|
container_name: jupyterhub
|
|
networks:
|
|
- jupyterhub-network
|
|
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"
|
|
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: hotwa/notebook:latest
|
|
# Notebook directory inside user image
|
|
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
|
|
|
|
nginx:
|
|
image: nginx:latest
|
|
container_name: nginx-proxy
|
|
depends_on:
|
|
- hub
|
|
volumes:
|
|
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
|
|
- "./nginx-selfsigned.crt:/etc/ssl/certs/nginx-selfsigned.crt:ro"
|
|
- "./nginx-selfsigned.key:/etc/ssl/private/nginx-selfsigned.key:ro"
|
|
- "./dhparam.pem:/etc/ssl/certs/dhparam.pem:ro"
|
|
ports:
|
|
- "50000:443"
|
|
networks:
|
|
- jupyterhub-network
|
|
|
|
volumes:
|
|
jupyterhub-data:
|
|
|
|
networks:
|
|
jupyterhub-network:
|
|
name: jupyterhub-network
|
|
|
|
# use 127.0.0.1:8000 access
|