version: '3'

services:
  # Configuration for Hub+Proxy
  jupyterhub:
    image: ${COMPOSE_PROJECT_NAME}_hub_img
    build: jupyterhub                # Build the container from this folder.
    container_name: ${COMPOSE_PROJECT_NAME}_hub    # The service will use this container name.
    volumes:                         # Give access to Docker socket.
      - /var/run/docker.sock:/var/run/docker.sock
      - ./jupyterhub/jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py
    environment:                     # Env variables passed to the Hub process.
      DOCKER_JUPYTER_IMAGE: jupyter/minimal-notebook
      DOCKER_NETWORK_NAME: ${COMPOSE_PROJECT_NAME}_default
      HUB_IP: ${COMPOSE_PROJECT_NAME}_hub
    ports:
      - "8000:8000"

  # Configuration for the single-user servers
  jupyterlab:
    image: jupyter/minimal-notebook
    network_mode: none
    command: echo

networks:
  default:
     name: ${COMPOSE_PROJECT_NAME}_default
