-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-local.yml
More file actions
212 lines (190 loc) · 6.8 KB
/
Copy pathdocker-compose-local.yml
File metadata and controls
212 lines (190 loc) · 6.8 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
version: "3.9"
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.3.2
container_name: zookeeper
restart: always
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_SERVERS: zoo1:2888:3888
# volumes:
# - ./data/zookeeper/data:/data
# - ./data/zookeeper/datalog:/datalog
networks:
- api_network
kafka:
container_name: kafka
image: confluentinc/cp-kafka:7.3.2
hostname: kafka
ports:
- "9091:9091"
- "29091:29091"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:19091,EXTERNAL://${DOCKER_HOST_IP:-host.docker.internal}:9091,DOCKER://host.docker.internal:29091
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.authorizer.AclAuthorizer
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
# volumes:
# - ./data/kafka/data:/var/lib/kafka/data
depends_on:
- zookeeper
networks:
- api_network
init-kafka:
container_name: init-kafka
image: confluentinc/cp-kafka:7.3.2
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
kafka-topics --bootstrap-server kafka:29091 --list
echo -e 'Creating kafka topics'
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic purchase --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic purchase-result --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic update-product-inventory --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic rollback-product-inventory --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic create-order --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic rollback-order --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic create-payment --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic rollback-payment --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic reply --replication-factor 1 --partitions 10
kafka-topics --bootstrap-server kafka:29091 --create --if-not-exists --topic send-register-email --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics --bootstrap-server kafka:29091 --list
"
depends_on:
- kafka
networks:
- api_network
mailhog:
image: mailhog/mailhog:latest
ports:
- "8025:8025"
- "1025:1025"
deploy:
mode: replicated
replicas: 1
minio:
container_name: minio
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: admin123456
MINIO_ROOT_PASSWORD: secret123456
volumes:
- ./data/minio:/data
command: server --console-address ":9001" /data
networks:
- test_network
init-minio:
container_name: init-minio
image: minio/minio:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 admin123456 secret123456;
/usr/bin/mc mb myminio/images;
/usr/bin/mc anonymous set download myminio/images;
/usr/bin/mc mb myminio/videos;
/usr/bin/mc anonymous set download myminio/videos;
"
networks:
- test_network
redis-node-1:
container_name: redis-node-1
image: redis/redis-stack-server:latest
volumes:
- ./build/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./data/redis-node-1:/data
ports:
- "7000:7000"
- "17000:17000"
entrypoint: [ "redis-server", "/usr/local/etc/redis/redis.conf", --port,"7000", --loadmodule, "/opt/redis-stack/lib/redisbloom.so" ]
networks:
- api_network
redis-node-2:
container_name: redis-node-2
image: redis/redis-stack-server:latest
volumes:
- ./build/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./data/redis-node-2:/data
ports:
- "7001:7001"
- "17001:17001"
entrypoint: [ "redis-server", "/usr/local/etc/redis/redis.conf", --port,"7001", --loadmodule, "/opt/redis-stack/lib/redisbloom.so" ]
networks:
- api_network
redis-node-3:
container_name: redis-node-3
image: redis/redis-stack-server:latest
volumes:
- ./build/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./data/redis-node-3:/data
ports:
- "7002:7002"
- "17002:17002"
entrypoint: [ "redis-server", "/usr/local/etc/redis/redis.conf", --port,"7002", --loadmodule, "/opt/redis-stack/lib/redisbloom.so" ]
networks:
- api_network
redis-node-4:
container_name: redis-node-4
image: redis/redis-stack-server:latest
volumes:
- ./build/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./data/redis-node-4:/data
ports:
- "7003:7003"
- "17003:17003"
entrypoint: [ "redis-server", "/usr/local/etc/redis/redis.conf", --port,"7003", --loadmodule, "/opt/redis-stack/lib/redisbloom.so" ]
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
networks:
- api_network
redis-node-5:
container_name: redis-node-5
image: redis/redis-stack-server:latest
volumes:
- ./build/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./data/redis-node-5:/data
ports:
- "7004:7004"
- "17004:17004"
entrypoint: [ "redis-server", "/usr/local/etc/redis/redis.conf", --port,"7004", --loadmodule, "/opt/redis-stack/lib/redisbloom.so" ]
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
networks:
- api_network
redis-node-6:
container_name: redis-node-6
image: redis/redis-stack-server:latest
volumes:
- ./build/redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./data/redis-node-6:/data
ports:
- "7005:7005"
- "17005:17005"
entrypoint: [ "redis-server", "/usr/local/etc/redis/redis.conf", --port,"7005", --loadmodule, "/opt/redis-stack/lib/redisbloom.so" ]
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
networks:
- api_network
networks:
api_network:
driver: bridge