-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (93 loc) · 2.45 KB
/
Copy pathdocker-compose.yml
File metadata and controls
98 lines (93 loc) · 2.45 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
version: '3.8'
services:
article_tags:
image: 'article_tags:latest'
container_name: 'article_tags'
hostname: 'article_tags'
build: ./article_tags
ports:
- '8081:8081'
restart: on-failure
depends_on:
kafka:
condition: service_healthy
mongodb:
condition: service_healthy
read_tags:
image: 'read_tags:latest'
container_name: 'read_tags'
hostname: 'read_tags'
build: ./read_tags
ports:
- '8082:8082'
restart: on-failure
depends_on:
cassandra:
condition: service_healthy
kafka:
condition: service_healthy
mongodb:
image: 'mongo'
container_name: 'mongodb'
hostname: 'mongodb'
environment:
- MONGO_INITDB_DATABASE=articles
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=pass
volumes:
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
ports:
- '27017:27017'
- '27019:27019'
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
interval: 5s
timeout: 5s
retries: 3
cassandra:
image: 'bitnami/cassandra:latest'
container_name: cassandra
hostname: cassandra
ports:
- '9042:9042'
healthcheck:
test: [ "CMD-SHELL", "[ $$(nodetool statusgossip) = running ]" ]
interval: 5s
timeout: 5s
retries: 3
restart: on-failure
zookeeper:
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper
hostname: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOO_4LW_COMMANDS_WHITELIST: stat,ruok,conf,isro
restart: on-failure
healthcheck:
test: echo ruok | nc -w 2 zookeeper 2181
interval: 5s
timeout: 5s
retries: 3
kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
hostname: kafka
depends_on:
- zookeeper
ports:
- 9092:9092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
restart: on-failure
healthcheck:
test: kafka-topics --list --zookeeper zookeeper:2181
interval: 5s
timeout: 5s
retries: 3