version: '2.4'
services:
  node-init:
    image: "nexus.gz1.opensdn.io:5102/opensdn-node-init:nightly"
    env_file: /etc/contrail/common_vrouter.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/agent:/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/opensdn-nodemgr:nightly"
    env_file: /etc/contrail/common_vrouter.env
    environment:
      - NODE_TYPE=vrouter
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/contrail/loadbalancer:/var/lib/contrail/loadbalancer
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: on-failure
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"


  provisioner:
    image: "nexus.gz1.opensdn.io:5102/opensdn-provisioner:nightly"
    env_file:
      - /etc/contrail/common_vrouter.env
    environment:
      - NODE_TYPE=vrouter
    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"


  vrouter-kernel-init:
    image: "nexus.gz1.opensdn.io:5102/opensdn-vrouter-kernel-build-init:nightly"
    network_mode: host
    privileged: true
    env_file: /etc/contrail/common_vrouter.env
    pid: host
    volumes:
      - /lib/modules:/lib/modules
      - /bin:/host/bin
      - /usr/src:/usr/src
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: on-failure
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  vrouter-agent:
    image: "nexus.gz1.opensdn.io:5102/opensdn-vrouter-agent:nightly"
    network_mode: host

    privileged: true
    pid: host
    env_file: /etc/contrail/common_vrouter.env
    volumes:
      - /usr/src:/usr/src
      - /lib/modules:/lib/modules
      - /bin:/host/bin
      - /etc:/host/etc
      - /var/lib/contrail:/var/lib/contrail
      - /var/run:/var/run
      - /dev:/dev
      - /etc/resolv.conf:/etc/resolv.conf
    volumes_from:
      - node-init
    depends_on:
      - vrouter-kernel-init
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"
