Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
278 lines (264 loc) · 7.04 KB
/
Copy pathdocker-compose.yml
File metadata and controls
278 lines (264 loc) · 7.04 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
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
services:
service-discovery:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: service-discovery
JAR_NAME: service-discovery-1.0.0.jar
ports:
- "8761:8761"
networks:
- bank-network
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8761/actuator/health" ]
interval: 10s
timeout: 5s
retries: 8
config-server:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: config-server
JAR_NAME: config-server-1.0.0.jar
ports:
- "8888:8888"
depends_on:
service-discovery:
condition: service_healthy
networks:
- bank-network
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8888/actuator/health" ]
interval: 10s
timeout: 5s
retries: 8
postgres-user:
image: postgres:17
environment:
POSTGRES_DB: userdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5433:5432"
volumes:
- pgdata-user:/var/lib/postgresql/data
networks:
- bank-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
user-service:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: user-service
JAR_NAME: user-service-1.0.0.jar
environment:
SPRING_CONFIG_IMPORT: optional:configserver:http://config-server:8888
USER_DB_URL: r2dbc:postgresql://postgres-user:5432/userdb
USER_DB_JDBC_URL: jdbc:postgresql://postgres-user:5432/userdb
USER_DB_USER: postgres
USER_DB_PASS: postgres
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://service-discovery:8761/eureka
depends_on:
postgres-user:
condition: service_healthy
config-server:
condition: service_healthy
service-discovery:
condition: service_healthy
networks:
- bank-network
postgres-product:
image: postgres:17
environment:
POSTGRES_DB: productdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5434:5432"
volumes:
- pgdata-product:/var/lib/postgresql/data
networks:
- bank-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
product-service:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: product-service
JAR_NAME: product-service-1.0.0.jar
environment:
SPRING_CONFIG_IMPORT: optional:configserver:http://config-server:8888
PRODUCT_DB_URL: jdbc:postgresql://postgres-product:5432/productdb
PRODUCT_DB_USER: postgres
PRODUCT_DB_PASS: postgres
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://service-discovery:8761/eureka
depends_on:
postgres-product:
condition: service_healthy
config-server:
condition: service_healthy
service-discovery:
condition: service_healthy
networks:
- bank-network
postgres-assignment:
image: postgres:17
environment:
POSTGRES_DB: assignmentdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- pgdata-assignment:/var/lib/postgresql/data
networks:
- bank-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
assignment-service:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: assignment-service
JAR_NAME: assignment-service-1.0.0.jar
environment:
SPRING_CONFIG_IMPORT: optional:configserver:http://config-server:8888
ASSIGNMENT_DB_URL: jdbc:postgresql://postgres-assignment:5432/assignmentdb
ASSIGNMENT_DB_USER: postgres
ASSIGNMENT_DB_PASS: postgres
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://service-discovery:8761/eureka
depends_on:
postgres-assignment:
condition: service_healthy
config-server:
condition: service_healthy
service-discovery:
condition: service_healthy
networks:
- bank-network
postgres-app:
image: postgres:17
environment:
POSTGRES_DB: appdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5436:5432"
volumes:
- pgdata-app:/var/lib/postgresql/data
networks:
- bank-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
application-service:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: application-service
JAR_NAME: application-service-1.0.0.jar
environment:
SPRING_CONFIG_IMPORT: optional:configserver:http://config-server:8888
APP_DB_URL: jdbc:postgresql://postgres-app:5432/appdb
APP_DB_USER: postgres
APP_DB_PASS: postgres
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://service-discovery:8761/eureka
depends_on:
postgres-app:
condition: service_healthy
config-server:
condition: service_healthy
service-discovery:
condition: service_healthy
networks:
- bank-network
postgres-tag:
image: postgres:17
environment:
POSTGRES_DB: tagdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5437:5432"
volumes:
- pgdata-tag:/var/lib/postgresql/data
networks:
- bank-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
tag-service:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: tag-service
JAR_NAME: tag-service-1.0.0.jar
environment:
SPRING_CONFIG_IMPORT: optional:configserver:http://config-server:8888
TAG_DB_URL: jdbc:postgresql://postgres-tag:5432/tagdb
TAG_DB_USER: postgres
TAG_DB_PASS: postgres
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://service-discovery:8761/eureka
depends_on:
postgres-tag:
condition: service_healthy
config-server:
condition: service_healthy
service-discovery:
condition: service_healthy
networks:
- bank-network
gateway:
build:
context: .
dockerfile: Dockerfile
args:
MODULE_PATH: gateway
JAR_NAME: gateway-1.0.0.jar
ports:
- "8080:8080"
environment:
SPRING_CONFIG_IMPORT: optional:configserver:http://config-server:8888
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://service-discovery:8761/eureka
depends_on:
user-service:
condition: service_started
product-service:
condition: service_started
application-service:
condition: service_started
assignment-service:
condition: service_started
tag-service:
condition: service_started
networks:
- bank-network
networks:
bank-network:
driver: bridge
volumes:
pgdata-user:
pgdata-product:
pgdata-assignment:
pgdata-app:
pgdata-tag: