-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
106 lines (104 loc) · 2.82 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
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
99
100
101
102
103
104
105
106
version: '3.1'
services:
mongo_one:
container_name: mongo_one
image: mongo
command: mongod --replSet rs1
ports:
- 30001:27017
networks:
- mom
mongo_two:
container_name: mongo_two
image: mongo
command: mongod --replSet rs1
ports:
- 30002:27017
networks:
- mom
mongo_three:
container_name: mongo_three
image: mongo
command: mongod --replSet rs1
ports:
- 30003:27017
networks:
- mom
zookeeper:
image: zookeeper:3.4.9
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zookeeper:2888:3888
volumes:
- ./zk-multiple-kafka-single/zookeeper/data:/data
- ./zk-multiple-kafka-single/zookeeper/datalog:/datalog
networks:
- mom
kafka1:
image: confluentinc/cp-kafka:5.5.0
hostname: kafka1
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_BROKER_ID: 1
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
volumes:
- ./zk-multiple-kafka-single/kafka1/data:/var/lib/kafka/data
depends_on:
- zookeeper
networks:
- mom
ms-extractor:
build: ./services/ms-extractor
container_name: ms-extractor
env_file:
- ./configs/.env
depends_on:
- mongo_one
- mongo_two
- mongo_three
- kafka1
ports:
- 8080:8080
volumes:
- ./services/ms-extractor:/go/src/mom/services/ms-extractor
environment:
- MONGO_URI=mongodb://mongo_one:27017,mongo_two:27017,mongo_three:27017/?replicaSet=rs1
- KAFKA_URI=kafka1:19092
- DIRECTORY="${MS-EXTRACTOR-DIR}"
# - MONGO_URI=mongodb://localhost:27017/?replicaSet=rs1&connect=direct
networks:
- mom
ms-consumer:
build: ./services/ms-consumer
container_name: ms-consumer
env_file:
- ./configs/.env
depends_on:
- mongo_one
- mongo_two
- mongo_three
- kafka1
ports:
- 8081:8081
volumes:
- ./services/ms-consumer:/go/src/mom/services/ms-consumer
environment:
- MONGO_URI=mongodb://mongo_one:27017,mongo_two:27017,mongo_three:27017/?replicaSet=rs1
- KAFKA_URI=kafka1:19092
- DIRECTORY="${MS-CONSUMER-DIR}"
# - MONGO_URI=mongodb://localhost:27017/?replicaSet=rs1&connect=direct
networks:
- mom
networks:
mom:
driver: bridge