-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
382 lines (353 loc) · 12.3 KB
/
compose.yaml
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
services:
### Messaging ###
zookeeper:
image: eventuateio/eventuate-zookeeper:0.17.0.RELEASE
volumes:
- zookeeper-data:/usr/local/zookeeper-data
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
KAFKA_HEAP_OPTS: -Xmx64m
kafka:
image: eventuateio/eventuate-kafka:0.17.0.RELEASE
volumes:
- kafka-data:/tmp/kafka-logs
ports:
- 9092:9092
depends_on:
- zookeeper
environment:
KAFKA_LISTENERS: LC://kafka:29092,LX://kafka:9092
KAFKA_ADVERTISED_LISTENERS: LC://kafka:29092,LX://${DOCKER_HOST_IP:-localhost}:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LC:PLAINTEXT,LX:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LC
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_HEAP_OPTS: -Xmx192m
kafka-ui:
image: provectuslabs/kafka-ui
ports:
- 8989:8080
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:22181
cdc-service:
image: eventuateio/eventuate-cdc-service:0.15.0.RELEASE
ports:
- 8099:8080
depends_on:
- kafka
- restaurant-service-db
- kitchen-service-db
- order-service-db
environment:
SPRING_PROFILE_ACTIVE: PostgresWal
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
EVENTUATE_CDC_PIPELINE_RESTAURANT_TYPE: eventuate-tram
EVENTUATE_CDC_PIPELINE_RESTAURANT_READER: restaurantservice
EVENTUATE_CDC_READER_RESTAURANTSERVICE_TYPE: postgres-wal
EVENTUATE_CDC_READER_RESTAURANTSERVICE_DATASOURCEDRIVERCLASSNAME: org.postgresql.Driver
EVENTUATE_CDC_READER_RESTAURANTSERVICE_DATASOURCEURL: jdbc:postgresql://restaurant-service-db/ftgo-restaurant-service
EVENTUATE_CDC_READER_RESTAURANTSERVICE_DATASOURCEUSERNAME: postgres
EVENTUATE_CDC_READER_RESTAURANTSERVICE_DATASOURCEPASSWORD: ''
EVENTUATE_CDC_READER_RESTAURANTSERVICE_LEADERSHIPLOCKPATH: /eventuate/cdc/leader/reader-restaurant-db
EVENTUATE_CDC_READER_RESTAURANTSERVICE_OUTBOXID: 8101
EVENTUATE_CDC_PIPELINE_CONSUMER_TYPE: eventuate-tram
EVENTUATE_CDC_PIPELINE_CONSUMER_READER: consumerservice
EVENTUATE_CDC_READER_CONSUMERSERVICE_TYPE: postgres-wal
EVENTUATE_CDC_READER_CONSUMERSERVICE_DATASOURCEDRIVERCLASSNAME: org.postgresql.Driver
EVENTUATE_CDC_READER_CONSUMERSERVICE_DATASOURCEURL: jdbc:postgresql://consumer-service-db/ftgo-consumer-service
EVENTUATE_CDC_READER_CONSUMERSERVICE_DATASOURCEUSERNAME: postgres
EVENTUATE_CDC_READER_CONSUMERSERVICE_DATASOURCEPASSWORD: ''
EVENTUATE_CDC_READER_CONSUMERSERVICE_LEADERSHIPLOCKPATH: /eventuate/cdc/leader/reader-consumer-db
EVENTUATE_CDC_READER_CONSUMERSERVICE_OUTBOXID: 8102
EVENTUATE_CDC_PIPELINE_ORDER_TYPE: eventuate-tram
EVENTUATE_CDC_PIPELINE_ORDER_READER: orderservice
EVENTUATE_CDC_READER_ORDERSERVICE_TYPE: postgres-wal
EVENTUATE_CDC_READER_ORDERSERVICE_DATASOURCEDRIVERCLASSNAME: org.postgresql.Driver
EVENTUATE_CDC_READER_ORDERSERVICE_DATASOURCEURL: jdbc:postgresql://order-service-db/ftgo-order-service
EVENTUATE_CDC_READER_ORDERSERVICE_DATASOURCEUSERNAME: postgres
EVENTUATE_CDC_READER_ORDERSERVICE_DATASOURCEPASSWORD: ''
EVENTUATE_CDC_READER_ORDERSERVICE_LEADERSHIPLOCKPATH: /eventuate/cdc/leader/reader-order-db
EVENTUATE_CDC_READER_ORDERSERVICE_OUTBOXID: 8103
EVENTUATE_CDC_PIPELINE_KITCHEN_TYPE: eventuate-tram
EVENTUATE_CDC_PIPELINE_KITCHEN_READER: kitchenservice
EVENTUATE_CDC_READER_KITCHENSERVICE_TYPE: postgres-wal
EVENTUATE_CDC_READER_KITCHENSERVICE_DATASOURCEDRIVERCLASSNAME: org.postgresql.Driver
EVENTUATE_CDC_READER_KITCHENSERVICE_DATASOURCEURL: jdbc:postgresql://kitchen-service-db/ftgo-kitchen-service
EVENTUATE_CDC_READER_KITCHENSERVICE_DATASOURCEUSERNAME: postgres
EVENTUATE_CDC_READER_KITCHENSERVICE_DATASOURCEPASSWORD: ''
EVENTUATE_CDC_READER_KITCHENSERVICE_LEADERSHIPLOCKPATH: /eventuate/cdc/leader/reader-kitchen-db
EVENTUATE_CDC_READER_KITCHENSERVICE_OUTBOXID: 8105
EVENTUATE_CDC_PIPELINE_DELIVERY_TYPE: eventuate-tram
EVENTUATE_CDC_PIPELINE_DELIVERY_READER: deliveryservice
EVENTUATE_CDC_READER_DELIVERYSERVICE_TYPE: postgres-wal
EVENTUATE_CDC_READER_DELIVERYSERVICE_DATASOURCEDRIVERCLASSNAME: org.postgresql.Driver
EVENTUATE_CDC_READER_DELIVERYSERVICE_DATASOURCEURL: jdbc:postgresql://delivery-service-db/ftgo-delivery-service
EVENTUATE_CDC_READER_DELIVERYSERVICE_DATASOURCEUSERNAME: postgres
EVENTUATE_CDC_READER_DELIVERYSERVICE_DATASOURCEPASSWORD: ''
EVENTUATE_CDC_READER_DELIVERYSERVICE_LEADERSHIPLOCKPATH: /eventuate/cdc/leader/reader-delivery-db
EVENTUATE_CDC_READER_DELIVERYSERVICE_OUTBOXID: 8108
### Databases ###
restaurant-service-db:
restart: always
build:
context: ./database
target: base
volumes:
- restaurant-service-db-data:/var/lib/postgresql/data
ports:
- 8201:5432
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=ftgo-restaurant-service
- USE_DB_ID=true
consumer-service-db:
restart: always
build:
context: ./database
target: base
volumes:
- consumer-service-db-data:/var/lib/postgresql/data
ports:
- 8202:5432
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=ftgo-consumer-service
- USE_DB_ID=true
kitchen-service-db:
restart: always
build:
context: ./database
target: saga
volumes:
- kitchen-service-db-data:/var/lib/postgresql/data
ports:
- 8205:5432
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=ftgo-kitchen-service
- USE_DB_ID=true
order-service-db:
restart: always
build:
context: ./database
target: saga
volumes:
- order-service-db-data:/var/lib/postgresql/data
ports:
- 8203:5432
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=ftgo-order-service
- USE_DB_ID=true
accounting-service-db:
image: eventstore/eventstore:22.10.1-alpha-arm64v8
# image: eventstore/eventstore:22.10.1-buster-slim
environment:
- EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
- EVENTSTORE_EXT_TCP_PORT=1113
- EVENTSTORE_HTTP_PORT=2113
- EVENTSTORE_INSECURE=true
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
ports:
- "8204:1113"
- "8304:2113"
volumes:
- type: volume
source: accounting-service-db-data
target: /var/lib/eventstore
- type: volume
source: accounting-service-db-logs
target: /var/log/eventstore
accounting-service-projection-db:
restart: always
image: postgres:15-alpine
volumes:
- accounting-service-projection-db-data:/var/lib/postgresql/data
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=ftgo-accounting-service
order-history-service-db:
restart: always
image: amazon/dynamodb-local
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data"
user: root
ports:
- "8206:8000"
volumes:
- order-history-service-db-data:/home/dynamodblocal/data
environment:
JAVA_OPTS: -Xmx128m
delivery-service-db:
restart: always
build:
context: ./database
target: base
volumes:
- delivery-service-db-data:/var/lib/postgresql/data
ports:
- 8208:5432
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=ftgo-delivery-service
- USE_DB_ID=true
### Applications ###
restaurant-service-app:
build:
context: .
target: restaurant-service
ports:
- 8101:8101
depends_on:
- restaurant-service-db
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://restaurant-service-db/ftgo-restaurant-service
SPRING_DATASOURCE_USERNAME: postgres
consumer-service-app:
build:
context: .
target: consumer-service
ports:
- 8102:8102
depends_on:
- consumer-service-db
- kafka
- zookeeper
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://consumer-service-db/ftgo-consumer-service
SPRING_DATASOURCE_USERNAME: postgres
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
kitchen-service-app:
build:
context: .
target: kitchen-service
ports:
- 8105:8105
depends_on:
- kitchen-service-db
- kafka
- zookeeper
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://kitchen-service-db/ftgo-kitchen-service
SPRING_DATASOURCE_USERNAME: postgres
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
DESTINATIONS_ORDER_SERVICE_URL: order-service-app:8107
order-service-app:
build:
context: .
target: order-service
ports:
- 8103:8103
- 8107:8107
depends_on:
- order-service-db
- kafka
- zookeeper
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://order-service-db/ftgo-order-service
SPRING_DATASOURCE_USERNAME: postgres
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
accounting-service-app:
build:
context: .
target: accounting-service
ports:
- 8104:8104
depends_on:
- accounting-service-db
- accounting-service-projection-db
- kafka
- zookeeper
environment:
DATABASE_URI: esdb://accounting-service-db:2113?tls=false
SPRING_DATASOURCE_URL: jdbc:postgresql://accounting-service-projection-db/ftgo-accounting-service
SPRING_DATASOURCE_USERNAME: postgres
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
order-history-service-app:
build:
context: .
target: order-history-service
ports:
- 8106:8106
depends_on:
- order-history-service-db
- kafka
- zookeeper
environment:
AWS_DYNAMODB_ENDPOINT_URL: http://order-history-service-db:8000
AWS_REGION: ${AWS_REGION:-ap-northeast-2}
AWS_ACCESS_KEY_ID: "dummy"
AWS_SECRET_ACCESS_KEY: "dummy"
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
order-history-service-db-init:
build:
context: .
target: order-history-service
entrypoint:
- "java"
- "-cp"
- ".:./lib/*"
- "-Dspring.profiles.active=cli"
- "me.jangjunha.ftgo.order_history_service.OrderHistoryServiceMainKt"
- "db"
- "create"
depends_on:
- order-history-service-db
- kafka
- zookeeper
environment:
AWS_DYNAMODB_ENDPOINT_URL: http://order-history-service-db:8000
AWS_REGION: ${AWS_REGION:-ap-northeast-2}
AWS_ACCESS_KEY_ID: "dummy"
AWS_SECRET_ACCESS_KEY: "dummy"
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
delivery-service-app:
build:
context: .
target: delivery-service
ports:
- 8108:8108
depends_on:
- delivery-service-db
- kafka
- zookeeper
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://delivery-service-db/ftgo-delivery-service
SPRING_DATASOURCE_USERNAME: postgres
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
DESTINATIONS_KITCHEN_SERVICE_URL: kitchen-service-app:8105
### Etc ###
api-gateway:
build:
context: .
target: api-gateway
ports:
- 8199:8199
environment:
DESTINATIONS_ORDER_SERVICE_URL: order-service-app:8107
DESTINATIONS_ORDER_HISTORY_SERVICE_URL: http://order-history-service-app:8106/
DESTINATIONS_KITCHEN_SERVICE_URL: kitchen-service-app:8105
DESTINATIONS_RESTAURANT_SERVICE_URL: http://restaurant-service-app:8101/
volumes:
zookeeper-data: {}
kafka-data: {}
restaurant-service-db-data: {}
consumer-service-db-data: {}
kitchen-service-db-data: {}
order-service-db-data: {}
accounting-service-db-data: {}
accounting-service-db-logs: {}
accounting-service-projection-db-data: {}
order-history-service-db-data: {}
delivery-service-db-data: {}