-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
60 lines (55 loc) · 1.6 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: '2'
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper-container
ports:
- "2181:2181"
restart: unless-stopped
kafka:
image: wurstmeister/kafka
container_name: kafka-container
ports:
- "9092:9092"
expose:
- "9093"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_CREATE_TOPICS: "comments:1:1"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
cassandra-seed:
image: cassandra:4.1.0
ports:
- "9042:9042"
container_name: cassandra-seed-container
environment:
CASSANDRA_SEEDS: cassandra-seed
restart: always
healthcheck:
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
interval: 15s
timeout: 10s
retries: 10
networks:
- cassandra-network
cassandra-init:
container_name: cassandra-init
image: cassandra:4.1.0
depends_on:
cassandra-seed:
condition: service_healthy
volumes:
- ./cassandra-schema.cql:/schema.cql
command: /bin/bash -c "echo Loading cassandra keyspace... && cqlsh cassandra-seed-container -f /schema.cql"
networks:
- cassandra-network
networks:
cassandra-network:
driver: bridge