dockerizing_cassandra/docker-compose.yml

87 lines
2.1 KiB
YAML
Raw Normal View History

2024-07-24 15:03:39 +02:00
version: '3.8'
services:
cassandra1:
2024-07-24 15:41:02 +02:00
image: cassandra:4.1.3
2024-07-24 15:03:39 +02:00
container_name: cassandra1
env_file:
- .env
environment:
- CASSANDRA_BROADCAST_ADDRESS=cassandra1
2024-07-24 15:41:02 +02:00
- CASSANDRA_LISTEN_ADDRESS=cassandra1
- CASSANDRA_RPC_ADDRESS=cassandra1
- CASSANDRA_DC=DC1
- CASSANDRA_RACK=RAC1
2024-07-24 15:03:39 +02:00
- PRIMARY_NODE=true
volumes:
- ./data/dumps/node1:/dump
- ./data/volumes/node1:/var/lib/cassandra
- ./logs/node1:/var/log/cassandra
ports:
- "9042:9042"
networks:
- cassandra-net
2024-07-24 15:41:02 +02:00
# healthcheck:
# test: ["CMD", "cqlsh", "-e", "DESCRIBE KEYSPACES"]
# interval: 30s
# timeout: 10s
# retries: 5
2024-07-24 15:03:39 +02:00
cassandra2:
2024-07-24 15:41:02 +02:00
image: cassandra:4.1.3
2024-07-24 15:03:39 +02:00
container_name: cassandra2
env_file:
- .env
environment:
- CASSANDRA_BROADCAST_ADDRESS=cassandra2
2024-07-24 15:41:02 +02:00
- CASSANDRA_LISTEN_ADDRESS=cassandra2
- CASSANDRA_RPC_ADDRESS=cassandra2
- CASSANDRA_DC=DC1
- CASSANDRA_RACK=RAC1
2024-07-24 15:03:39 +02:00
- PRIMARY_NODE=false
volumes:
- ./data/dumps/node2:/dump
- ./data/volumes/node2:/var/lib/cassandra
- ./logs/node2:/var/log/cassandra
networks:
- cassandra-net
2024-07-24 15:41:02 +02:00
# depends_on:
# cassandra1:
# condition: service_healthy
# healthcheck:
# test: ["CMD", "cqlsh", "-e", "DESCRIBE KEYSPACES"]
# interval: 30s
# timeout: 10s
# retries: 5
2024-07-24 15:03:39 +02:00
cassandra3:
2024-07-24 15:41:02 +02:00
image: cassandra:4.1.3
2024-07-24 15:03:39 +02:00
container_name: cassandra3
env_file:
- .env
environment:
- CASSANDRA_BROADCAST_ADDRESS=cassandra3
2024-07-24 15:41:02 +02:00
- CASSANDRA_LISTEN_ADDRESS=cassandra3
- CASSANDRA_RPC_ADDRESS=cassandra3
- CASSANDRA_DC=DC1
- CASSANDRA_RACK=RAC1
2024-07-24 15:03:39 +02:00
- PRIMARY_NODE=false
volumes:
- ./data/dumps/node3:/dump
- ./data/volumes/node3:/var/lib/cassandra
- ./logs/node3:/var/log/cassandra
networks:
- cassandra-net
2024-07-24 15:41:02 +02:00
# depends_on:
# cassandra2:
# condition: service_healthy
# healthcheck:
# test: ["CMD", "cqlsh", "-e", "DESCRIBE KEYSPACES"]
# interval: 30s
# timeout: 10s
# retries: 5
2024-07-24 15:03:39 +02:00
networks:
cassandra-net:
driver: bridge