-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
348 lines (329 loc) · 9.9 KB
/
Copy pathdocker-compose.yml
File metadata and controls
348 lines (329 loc) · 9.9 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
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
---
version: "3.8"
services:
# ----------------------------------------------------------------
# Service Discovery and Gateway
# ----------------------------------------------------------------
eureka-server:
build:
context: ./code/backend/eureka-server
dockerfile: Dockerfile
image: finovabank/eureka-server
container_name: eureka-server
ports:
- "8001:8001"
networks:
- finova-network
environment:
- EUREKA_SERVER_PORT=8001
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/actuator/health"]
interval: 30s
timeout: 10s
retries: 5
api-gateway:
build:
context: ./code/backend/api-gateway
dockerfile: Dockerfile
image: finovabank/api-gateway
container_name: api-gateway
ports:
- "8002:8002"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- API_GATEWAY_PORT=8002
- SPRING_PROFILES_ACTIVE=docker
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/actuator/health"]
interval: 30s
timeout: 10s
retries: 5
# ----------------------------------------------------------------
# Core Business Microservices
# ----------------------------------------------------------------
auth-service:
build:
context: ./code/backend/auth-service
dockerfile: Dockerfile
image: finovabank/auth-service
container_name: auth-service
ports:
- "8080:8080" # Exposed for direct testing/debug, usually accessed via gateway
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- AUTH_SERVICE_PORT=8080
- SPRING_PROFILES_ACTIVE=docker
security-service:
build:
context: ./code/backend/security-service
dockerfile: Dockerfile
image: finovabank/security-service
container_name: security-service
ports:
- "8089:8089"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- SECURITY_SERVICE_PORT=8089
- SPRING_PROFILES_ACTIVE=docker
account-management:
build:
context: ./code/backend/account-management
dockerfile: Dockerfile
image: finovabank/account-management
container_name: account-management
ports:
- "8081:8081"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- ACCOUNT_MANAGEMENT_PORT=8081
- SPRING_PROFILES_ACTIVE=docker
transaction-service:
build:
context: ./code/backend/transaction-service
dockerfile: Dockerfile
image: finovabank/transaction-service
container_name: transaction-service
ports:
- "8082:8082"
depends_on:
eureka-server:
condition: service_healthy
account-management:
condition: service_started
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- TRANSACTION_SERVICE_PORT=8082
- SPRING_PROFILES_ACTIVE=docker
notification-service:
build:
context: ./code/backend/notification-service
dockerfile: Dockerfile
image: finovabank/notification-service
container_name: notification-service
ports:
- "8083:8083"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- NOTIFICATION_SERVICE_PORT=8083
- SPRING_PROFILES_ACTIVE=docker
loan-management:
build:
context: ./code/backend/loan-management
dockerfile: Dockerfile
image: finovabank/loan-management
container_name: loan-management
ports:
- "8084:8084"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- LOAN_MANAGEMENT_PORT=8084
- SPRING_PROFILES_ACTIVE=docker
compliance-service:
build:
context: ./code/ml-services/compliance-service
dockerfile: Dockerfile
image: finovabank/compliance-service
container_name: compliance-service
ports:
- "8013:8013"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- COMPLIANCE_SERVICE_PORT=8013
- SPRING_PROFILES_ACTIVE=docker
reporting:
build:
context: ./code/backend/reporting
dockerfile: Dockerfile
image: finovabank/reporting
container_name: reporting-service
ports:
- "8086:8086"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- REPORTING_SERVICE_PORT=8086
- SPRING_PROFILES_ACTIVE=docker
risk-assessment:
build:
context: ./code/ml-services/risk-assessment
dockerfile: Dockerfile
image: finovabank/risk-assessment
container_name: risk-assessment-service
ports:
- "8014:8014"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- RISK_ASSESSMENT_SERVICE_PORT=8014
- SPRING_PROFILES_ACTIVE=docker
savings-goals:
build:
context: ./code/backend/savings-goals
dockerfile: Dockerfile
image: finovabank/savings-goals
container_name: savings-goals-service
ports:
- "8088:8088"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- SAVINGS_GOALS_SERVICE_PORT=8088
- SPRING_PROFILES_ACTIVE=docker
ai-service:
build:
context: ./code/ml-services/ai-service
dockerfile: Dockerfile
image: finovabank/ai-service
container_name: ai-service
ports:
- "8012:8012"
depends_on:
eureka-server:
condition: service_healthy
networks:
- finova-network
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- AI_SERVICE_PORT=8012
- SPRING_PROFILES_ACTIVE=docker
# ----------------------------------------------------------------
# Frontend Applications
# ----------------------------------------------------------------
web-frontend:
build:
context: ./web-frontend
dockerfile: Dockerfile
image: finovabank/web-frontend
container_name: web-frontend
ports:
- "3000:80"
depends_on:
api-gateway:
condition: service_healthy
networks:
- finova-network
environment:
- REACT_APP_API_BASE_URL=http://api-gateway:8002
mobile-frontend-dev:
# This service is for development/hot-reloading of the React Native app.
# It does not build the native app, only runs the JS bundler.
build:
context: ./mobile-frontend
dockerfile: Dockerfile.dev # Assuming a Dockerfile.dev exists or needs to be created for RN development
image: finovabank/mobile-frontend-dev
container_name: mobile-frontend-dev
# The React Native packager runs on port 8081 by default, but it's often better to expose the host port
# for the development server and let the native app connect to the host IP.
ports:
- "8081:8081"
depends_on:
api-gateway:
condition: service_healthy
networks:
- finova-network
volumes:
- ./mobile-frontend:/app
- /app/node_modules
command: ["npm", "start"]
environment:
# The mobile app will need to connect to the API Gateway.
# When running on a device/emulator, it usually needs the host's IP, but in docker-compose,
# the service name is fine if the native app is also containerized or configured correctly.
# For simplicity in a docker-compose context, we'll point it to the gateway service name.
- REACT_NATIVE_API_BASE_URL=http://api-gateway:8002
- NODE_ENV=development
# ----------------------------------------------------------------
# Monitoring Stack (Optional but recommended)
# ----------------------------------------------------------------
prometheus:
image: prom/prometheus:v2.47.1
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- finova-network
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
# Prometheus needs to scrape all microservices, so it depends on them.
depends_on:
api-gateway:
condition: service_healthy
restart: unless-stopped
grafana:
image: grafana/grafana:10.1.5
container_name: grafana
ports:
- "3001:3000" # Grafana default port is 3000
volumes:
- grafana-storage:/var/lib/grafana
- ./monitoring/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
- ./monitoring/grafana/grafana_dashboard.json:/etc/grafana/provisioning/dashboards/finova-dashboard.json
networks:
- finova-network
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
depends_on:
prometheus:
condition: service_started
restart: unless-stopped
# ----------------------------------------------------------------
# Volumes and Networks
# ----------------------------------------------------------------
volumes:
grafana-storage:
networks:
finova-network:
driver: bridge