-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
116 lines (107 loc) · 3.32 KB
/
compose.yaml
File metadata and controls
116 lines (107 loc) · 3.32 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
services:
mysql:
image: 'mysql:8.0'
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: sagadb
MYSQL_USER: sagauser
MYSQL_PASSWORD: sagapassword
ports:
- '3306:3306'
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "sagauser", "-psagapassword"]
interval: 10s
timeout: 5s
retries: 5
zookeeper:
image: 'confluentinc/cp-zookeeper:7.6.0'
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- '2181:2181'
kafka:
image: 'confluentinc/cp-kafka:7.6.0'
container_name: kafka
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://kafka:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
ports:
- '9092:9092'
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
depends_on:
- kafka
ports:
- '8989:8080'
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
product-service:
build: ./product-service
container_name: product-service
depends_on:
- kafka
- mysql
ports:
- '8081:8080'
restart: on-failure
environment:
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/sagadb?allowPublicKeyRetrieval=true&useSSL=false
SPRING_DATASOURCE_USERNAME: sagauser
SPRING_DATASOURCE_PASSWORD: sagapassword
order-service:
build: ./order-service
container_name: order-service
depends_on:
- kafka
- mysql
ports:
- '8082:8080'
restart: on-failure
environment:
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/sagadb?allowPublicKeyRetrieval=true&useSSL=false
SPRING_DATASOURCE_USERNAME: sagauser
SPRING_DATASOURCE_PASSWORD: sagapassword
payment-service:
build: ./payment-service
container_name: payment-service
depends_on:
- kafka
- mysql
ports:
- '8083:8080'
restart: on-failure
environment:
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/sagadb?allowPublicKeyRetrieval=true&useSSL=false
SPRING_DATASOURCE_USERNAME: sagauser
SPRING_DATASOURCE_PASSWORD: sagapassword
inventory-service:
build: ./inventory-service
container_name: inventory-service
depends_on:
- kafka
- mysql
ports:
- '8084:8080'
restart: on-failure
environment:
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/sagadb?allowPublicKeyRetrieval=true&useSSL=false
SPRING_DATASOURCE_USERNAME: sagauser
SPRING_DATASOURCE_PASSWORD: sagapassword