version: '2.4'
volumes:
  dnsmasq:
  tftp:
  dhcp_leases:
services:
  node-init:
    image: "nexus.gz1.opensdn.io:5102/opensdn-node-init:nightly"
    env_file: /etc/contrail/common_config.env
    environment:
      - CONTRAIL_STATUS_IMAGE="nexus.gz1.opensdn.io:5102/opensdn-status:nightly"
    privileged: true
    pid: host
    network_mode: "host"
    volumes:
      ['/usr/bin:/host/usr/bin', '/etc/contrail/ssl:/etc/contrail/ssl', '/etc/sysctl.d:/etc/sysctl.d',
        '/etc/hosts:/etc/hosts', '/etc/timezone:/etc/timezone', '/etc/localtime:/etc/localtime',
        '/var/log/contrail:/var/log/contrail', '/var/crashes:/var/crashes']

  nodemgr:
    image: "nexus.gz1.opensdn.io:5102/opensdn-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
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
  provisioner:
    image: "nexus.gz1.opensdn.io:5102/opensdn-provisioner:nightly"
    env_file:
      - /etc/contrail/common_config.env
      - /etc/contrail/defaults.env
    environment:
      - NODE_TYPE=config
    network_mode: "host"
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
  api:
    image: "nexus.gz1.opensdn.io:5102/opensdn-controller-config-api:nightly"
    env_file: /etc/contrail/common_config.env
    network_mode: "host"
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
  svcmonitor:
    image: "nexus.gz1.opensdn.io:5102/opensdn-controller-config-svcmonitor:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_config.env
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
  schema:
    image: "nexus.gz1.opensdn.io:5102/opensdn-controller-config-schema:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_config.env
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
  devicemgr:
    image: "nexus.gz1.opensdn.io:5102/opensdn-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
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
  dnsmasq:
    image: "nexus.gz1.opensdn.io:5102/opensdn-controller-config-dnsmasq:nightly"
    network_mode: "host"
    cap_add:
      - NET_ADMIN
      - NET_RAW
    env_file: /etc/contrail/common_config.env
    environment:
      - NODE_TYPE=device-manager
      - USE_EXTERNAL_TFTP=False
    volumes_from:
      - node-init
    volumes:
      - dnsmasq:/etc/dnsmasq
      - tftp:/etc/tftp
      - dhcp_leases:/var/lib/dnsmasq
    depends_on:
      - node-init
    restart: always
    stdin_open: True
    tty: True
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
