version: '2.4'
volumes:
  analytics_cassandra:
services:
  node-init:
    image: "nexus.gz1.opensdn.io:5002/contrail-node-init:nightly-r24.1-centos"
    env_file: /etc/contrail/common_analytics_database.env
    environment:
      - CONTRAIL_STATUS_IMAGE="nexus.gz1.opensdn.io:5002/contrail-status:nightly-r24.1-centos"
    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:5002/contrail-nodemgr:nightly-r24.1-centos"
    env_file: /etc/contrail/common_analytics_database.env
    environment:
      - NODE_TYPE=database
      - CASSANDRA_CQL_PORT=9042
      - CASSANDRA_JMX_LOCAL_PORT=7200
    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:5002/contrail-provisioner:nightly-r24.1-centos"
    env_file:
      - /etc/contrail/common_analytics_database.env
      - /etc/contrail/defaults.env
    environment:
      - NODE_TYPE=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"
  query-engine:
    image: "nexus.gz1.opensdn.io:5002/contrail-analytics-query-engine:nightly-r24.1-centos"
    network_mode: "host"
    cap_add:
      - SYS_PTRACE
    env_file: /etc/contrail/common_analytics_database.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"
  cassandra:
    image: "nexus.gz1.opensdn.io:5002/contrail-external-cassandra:nightly-r24.1-centos"
    env_file: /etc/contrail/common_analytics_database.env
    cap_add:
      - SYS_NICE
    environment:
      - CASSANDRA_SEEDS=10.0.0.22,10.0.0.19,10.0.0.129
      - CASSANDRA_START_RPC=true
      - CASSANDRA_CLUSTER_NAME=contrail_analytics
      - CASSANDRA_PORT=9160
      - CASSANDRA_CQL_PORT=9042
      - CASSANDRA_SSL_STORAGE_PORT=7011
      - CASSANDRA_STORAGE_PORT=7010
      - CASSANDRA_JMX_LOCAL_PORT=7200
      - NODE_TYPE=database
    volumes:
     - analytics_cassandra:/var/lib/cassandra/data
     - /etc/hosts:/etc/hosts
     - /etc/contrail/ssl:/etc/contrail/ssl
     - /var/log/contrail/database:/var/log/cassandra
    network_mode: "host"
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "10"
    restart: always
