version: '2.4'
volumes:
 config_cassandra:
 config_zookeeper:
services:
  node-init:
    image: "nexus.gz1.opensdn.io:5102/opensdn-node-init:nightly"
    env_file: /etc/contrail/common_config_database.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_database.env
    environment:
      - NODE_TYPE=config-database
      - CASSANDRA_CQL_PORT=9041
      - CASSANDRA_JMX_LOCAL_PORT=7201
    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_database.env
      - /etc/contrail/defaults.env
    environment:
      - NODE_TYPE=config-database
    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"
  cassandra:
    image: "nexus.gz1.opensdn.io:5102/opensdn-external-cassandra:nightly"
    env_file: /etc/contrail/common_config_database.env
    cap_add:
      - SYS_NICE
    environment:
      - CASSANDRA_SEEDS=10.0.0.38
      - CASSANDRA_START_RPC=true
      - CASSANDRA_CLUSTER_NAME=contrail_database
      - CASSANDRA_PORT=9161
      - CASSANDRA_CQL_PORT=9041
      - CASSANDRA_SSL_STORAGE_PORT=7013
      - CASSANDRA_STORAGE_PORT=7012
      - CASSANDRA_JMX_LOCAL_PORT=7201
      - NODE_TYPE=config-database
      - CASSANDRA_REAPER_ENABLED=true
      - CASSANDRA_REAPER_APP_PORT=8071
      - CASSANDRA_REAPER_ADM_PORT=8072
    volumes:
      - /etc/hosts:/etc/hosts
      - config_cassandra:/var/lib/cassandra/data
      - /etc/contrail/ssl:/etc/contrail/ssl
      - /var/log/contrail/config-database:/var/log/cassandra
    network_mode: "host"
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
    restart: always
  zookeeper:
    image: "nexus.gz1.opensdn.io:5102/opensdn-external-zookeeper:nightly"
    env_file: /etc/contrail/common_config_database.env
    environment:
      - ZOOKEEPER_NODES=10.0.0.38
      - ZOOKEEPER_PORTS=2888:3888
      - ZOOKEEPER_PORT=2181
      - NODE_TYPE=config-database
    volumes:
      - /etc/hosts:/etc/hosts
      - config_zookeeper:/data
      - /var/log/contrail/zookeeper:/var/log/zookeeper
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
    network_mode: "host"
    restart: always
  rabbitmq:
    image: "nexus.gz1.opensdn.io:5102/opensdn-external-rabbitmq:nightly"
    env_file: /etc/contrail/common_config_database.env
    environment:
      - RABBITMQ_NODES=10.0.0.38
      - RABBITMQ_ERLANG_COOKIE=abcdefg
      - NODE_TYPE=config-database
      - RABBITMQ_LOGS=/var/log/contrail/config-database-rabbitmq/rabbitmq.log
      - RAMMITMQ_SASL_LOGS=/var/log/contrail/config-database-rabbitmq/rabbitmq_sasl.log
    volumes:
      - /etc/contrail/ssl:/etc/contrail/ssl
      - /var/log/contrail/rabbitmq:/var/log/rabbitmq
    volumes_from:
      - node-init
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
    network_mode: "host"
    restart: always
