# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

services:
  cassandra:
    image: docker.io/bitnami/cassandra:5.0
    ports:
      - 7000:7000
      - 9042:9042
    volumes:
      - cassandra_data:/bitnami
    environment:
      - CASSANDRA_SEEDS=cassandra,cassandra2
      - CASSANDRA_CLUSTER_NAME=cassandra-cluster
      - CASSANDRA_PASSWORD_SEEDER=yes
      - CASSANDRA_PASSWORD=cassandra
      # By default, Cassandra autodetects the available host memory and takes as much as it can.
      # Therefore, memory options are mandatory if multiple Cassandras are launched in the same node.
      - MAX_HEAP_SIZE=2G
      - HEAP_NEWSIZE=200M
  cassandra2:
    image: docker.io/bitnami/cassandra:5.0
    ports:
      - 7001:7000
      - 9043:9042
    volumes:
      - cassandra2_data:/bitnami
    environment:
      - CASSANDRA_SEEDS=cassandra,cassandra2
      - CASSANDRA_CLUSTER_NAME=cassandra-cluster
      - CASSANDRA_PASSWORD=cassandra
      # By default, Cassandra autodetects the available host memory and takes as much as it can.
      # Therefore, memory options are mandatory if multiple Cassandras are launched in the same node.
      - MAX_HEAP_SIZE=2G
      - HEAP_NEWSIZE=200M
volumes:
  cassandra_data:
    driver: local
  cassandra2_data:
    driver: local
