version: '2'

volumes:
  dnsmasq:
  tftp:
  dhcp_leases:

services:
  node-init:
    image: "nexus.gz1.opensdn.io:5102/contrail-node-init:nightly"
    env_file: /etc/contrail/common_config.env
    environment:
      - CONTRAIL_STATUS_IMAGE="nexus.gz1.opensdn.io:5102/contrail-status:nightly"
    privileged: true
    pid: host
    network_mode: "host"
    volumes:
      - /usr/bin:/host/usr/bin
      - /etc/contrail/ssl/controller:/etc/contrail/ssl
      - /etc/sysctl.d:/etc/sysctl.d
      - /etc/hosts:/etc/hosts
      - /var/log/contrail:/var/log/contrail
      - /etc/timezone:/etc/timezone
      - /etc/localtime:/etc/localtime
      - /var/crashes:/var/crashes
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  nodemgr:
    image: "nexus.gz1.opensdn.io:5102/contrail-nodemgr:nightly"
    env_file:
      - /etc/contrail/common_config.env

    environment:
      - NODE_TYPE=config
    network_mode: "host"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"


  provisioner:
    image: "nexus.gz1.opensdn.io:5102/contrail-provisioner:nightly"
    env_file:
      - /etc/contrail/common_config.env
      - /etc/contrail/defaults_controller.env
    environment:
      - NODE_TYPE=config
    network_mode: "host"
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: on-failure
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"


  api:
    image: "nexus.gz1.opensdn.io:5102/contrail-controller-config-api:nightly"
    env_file: /etc/contrail/common_config.env
    network_mode: "host"
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  svcmonitor:
    image: "nexus.gz1.opensdn.io:5102/contrail-controller-config-svcmonitor:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_config.env
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  schema:
    image: "nexus.gz1.opensdn.io:5102/contrail-controller-config-schema:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_config.env
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  devicemgr:
    image: "nexus.gz1.opensdn.io:5102/contrail-controller-config-devicemgr:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_config.env
    volumes_from:
      - node-init

      - dnsmasq
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

    depends_on:
      - node-init

      - dnsmasq

    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"


  dnsmasq:
    image: "nexus.gz1.opensdn.io:5102/contrail-controller-config-dnsmasq:nightly"
    network_mode: "host"

    cap_add:
      - NET_ADMIN
      - NET_RAW

    env_file: /etc/contrail/common_config.env
    volumes_from:
      - node-init
    volumes:
      - dnsmasq:/etc/dnsmasq
      - tftp:/etc/tftp
      - dhcp_leases:/var/lib/dnsmasq
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

