-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
235 lines (216 loc) · 6.04 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
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
version: "3.9"
services:
# =====================
# ===== DATABASES =====
# =====================
mongodb-primary:
image: bitnami/mongodb:4.4.8-debian-10-r48
ports:
- "27017:27017"
restart: unless-stopped
environment:
MONGODB_ADVERTISED_HOSTNAME: mongodb-primary
MONGODB_REPLICA_SET_MODE: primary
MONGODB_ROOT_USER: root
MONGODB_ROOT_PASSWORD: admin
MONGODB_USERNAME: user
MONGODB_PASSWORD: password
MONGODB_DATABASE: app
MONGODB_REPLICA_SET_KEY: replicasetkey123
volumes:
- ./scripts/vehicle-service-initdb.js:/docker-entrypoint-initdb.d/vehicle-service-initdb.js
mongodb-secondary:
image: bitnami/mongodb:4.4.8-debian-10-r48
restart: unless-stopped
depends_on:
- mongodb-primary
environment:
MONGODB_REPLICA_SET_MODE: secondary
MONGODB_INITIAL_PRIMARY_HOST: mongodb-primary
MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD: admin
MONGODB_REPLICA_SET_KEY: replicasetkey123
mongodb-arbiter:
image: bitnami/mongodb:4.4.8-debian-10-r48
restart: unless-stopped
depends_on:
- mongodb-primary
environment:
MONGODB_REPLICA_SET_MODE: arbiter
MONGODB_INITIAL_PRIMARY_HOST: mongodb-primary
MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD: admin
MONGODB_REPLICA_SET_KEY: replicasetkey123
postgres:
image: debezium/postgres:13-alpine
ports:
- "5432:5432"
restart: unless-stopped
environment:
POSTGRES_DB: db
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
# ==========================
# ===== OTHER SERVICES =====
# ==========================
kafka:
image: bitnami/kafka:3.3.1-debian-11-r29
restart: unless-stopped
environment:
KAFKA_ENABLE_KRAFT: "yes"
KAFKA_CFG_PROCESS_ROLES: broker,controller
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_BROKER_ID: 1
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
ALLOW_PLAINTEXT_LISTENER: "yes"
kafdrop:
image: obsidiandynamics/kafdrop:3.27.0
ports:
- "9000:9000"
restart: unless-stopped
depends_on:
- kafka
environment:
KAFKA_BROKERCONNECT: kafka:9092
debezium-connect:
build:
context: ./custom-debezium-transformer
ports:
- "8083:8083"
restart: unless-stopped
depends_on:
- kafka
- postgres
environment:
CONFIG_STORAGE_TOPIC: debezium_connect_configs
OFFSET_STORAGE_TOPIC: debezium_connect_offsets
STATUS_STORAGE_TOPIC: debezium_connect_statuses
BOOTSTRAP_SERVERS: kafka:9092
GROUP_ID: 1
temporal:
image: temporalio/auto-setup:1.14.4
ports:
- "7233:7233"
restart: unless-stopped
depends_on:
- postgres
environment:
DB: postgresql
DB_PORT: 5432
POSTGRES_USER: admin
POSTGRES_PWD: admin
POSTGRES_SEEDS: postgres
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/development.yaml
volumes:
- ./temporal-config:/etc/temporal/config/dynamicconfig
temporal-admin-tools:
image: temporalio/admin-tools:1.14.2
restart: unless-stopped
depends_on:
- temporal
environment:
TEMPORAL_CLI_ADDRESS: temporal:7233
stdin_open: true
tty: true
temporal-web:
image: temporalio/web:1.13.0
ports:
- "8088:8088"
restart: unless-stopped
depends_on:
- temporal
environment:
TEMPORAL_GRPC_ENDPOINT: temporal:7233
TEMPORAL_PERMIT_WRITE_API: "true"
# =========================
# ===== MICROSERVICES =====
# =========================
rent-service:
image: car-sharing/rent-service
restart: unless-stopped
depends_on:
- postgres
- debezium-connect
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DATABASE: db
POSTGRES_SCHEMA: rent-service
POSTGRES_USERNAME: admin
POSTGRES_PASSWORD: admin
KAFKA_BOOSTRAP_SERVERS: kafka:9092
rent-orchestrator-service:
image: car-sharing/rent-orchestrator-service
restart: unless-stopped
depends_on:
- temporal
- kafka
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DATABASE: db
POSTGRES_USERNAME: admin
POSTGRES_PASSWORD: admin
KAFKA_BOOSTRAP_SERVERS: kafka:9092
TEMPORAL_HOST: temporal
TEMPORAL_PORT: 7233
customer-service:
image: car-sharing/customer-service
restart: unless-stopped
depends_on:
- kafka
- mongodb-primary
- mongodb-secondary
- mongodb-arbiter
environment:
MONGODB_HOSTS: mongodb-primary:27017,mongodb-secondary:27017
MONGODB_DATABASE: app
MONGODB_USERNAME: user
MONGODB_PASSWORD: password
KAFKA_BOOSTRAP_SERVERS: kafka:9092
vehicle-service:
image: car-sharing/vehicle-service
restart: unless-stopped
depends_on:
- kafka
- mongodb-primary
- mongodb-secondary
- mongodb-arbiter
environment:
MONGODB_HOSTS: mongodb-primary:27017,mongodb-secondary:27017
MONGODB_DATABASE: app
MONGODB_USERNAME: user
MONGODB_PASSWORD: password
KAFKA_BOOSTRAP_SERVERS: kafka:9092
payment-service:
image: car-sharing/payment-service
restart: unless-stopped
depends_on:
- kafka
- postgres
- debezium-connect
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DATABASE: db
POSTGRES_USERNAME: admin
POSTGRES_PASSWORD: admin
KAFKA_BOOSTRAP_SERVERS: kafka:9092
STRIPE_API_KEY: ${STRIPE_API_KEY}
api-gateway:
image: nginx:latest
ports:
- "80:80"
restart: unless-stopped
depends_on:
- rent-service
- customer-service
- vehicle-service
volumes:
- ./scripts/nginx-gateway.conf:/etc/nginx/nginx.conf
structurizr:
image: structurizr/lite:3193
restart: unless-stopped
ports:
- "8080:8080"