version: '2'
volumes:
  contrail_control_dns:
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=control
    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=control
    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"


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

    cap_add:
      - SYS_PTRACE

    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"

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

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

    cap_add:
      - SYS_PTRACE

    env_file: /etc/contrail/common_config.env
    pid: host
    volumes:
      - contrail_control_dns:/etc/contrail/dns
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"
