-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
301 lines (288 loc) · 9.55 KB
/
docker-compose.yml
File metadata and controls
301 lines (288 loc) · 9.55 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
version: "3.9"
services:
# ─────────────────────────────────────────
# INFRASTRUCTURE
# ─────────────────────────────────────────
postgres:
image: postgres:15-alpine
container_name: healthbridge-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- healthbridge-network
redis:
image: redis:7-alpine
container_name: healthbridge-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- healthbridge-network
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: healthbridge-rabbitmq
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 30s
timeout: 10s
retries: 5
networks:
- healthbridge-network
# ─────────────────────────────────────────
# API GATEWAY
# ─────────────────────────────────────────
api-gateway:
build:
context: ./api-gateway
dockerfile: Dockerfile
container_name: healthbridge-api-gateway
ports:
- "8080:8080"
environment:
PORT: 8080
NODE_ENV: production
GATEWAY_SECRET: ${GATEWAY_SECRET}
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
AUTH_SERVICE_URL: http://auth-service:3004
PROFILE_SERVICE_URL: http://profile-service:3007
DRUG_SERVICE_URL: http://drug-service:2012
PAYMENT_SERVICE_URL: http://payment-service:3002
AI_SERVICE_URL: http://ai-service:3001
NOTIFICATION_SERVICE_URL: http://notification-service:2002
depends_on:
- auth-service
- profile-service
- drug-service
- payment-service
- ai-service
- notification-service
networks:
- healthbridge-network
# ─────────────────────────────────────────
# AUTH SERVICE
# ─────────────────────────────────────────
auth-service:
build:
context: ./auth-service
dockerfile: Dockerfile
container_name: healthbridge-auth-service
environment:
PORT: 3004
NODE_ENV: production
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_NAME: auth_db
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
GATEWAY_SECRET: ${GATEWAY_SECRET}
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_EXCHANGE: auth-events
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
REDIS_HOST: redis
REDIS_PORT: 6379
FRONTEND_URL: http://frontend:80
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- healthbridge-network
# ─────────────────────────────────────────
# PROFILE SERVICE
# ─────────────────────────────────────────
profile-service:
build:
context: ./users-profile-service
dockerfile: Dockerfile
container_name: healthbridge-profile-service
environment:
PORT: 3007
NODE_ENV: production
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/profiles_db
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
GATEWAY_SECRET: ${GATEWAY_SECRET}
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_EXCHANGE: health-bridge-events
REDIS_HOST: redis
REDIS_PORT: 6379
FRONTEND_URL: http://frontend:80
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- healthbridge-network
# ─────────────────────────────────────────
# DRUG SERVICE
# ─────────────────────────────────────────
drug-service:
build:
context: ./drug-service
dockerfile: Dockerfile
container_name: healthbridge-drug-service
environment:
PORT: 2012
NODE_ENV: production
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/drugs_db
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
GATEWAY_SECRET: ${GATEWAY_SECRET}
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_EXCHANGE: health-bridge-events
CLIENT_URL: http://frontend:80
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- healthbridge-network
# ─────────────────────────────────────────
# PAYMENT SERVICE
# ─────────────────────────────────────────
payment-service:
build:
context: ./payment-service
dockerfile: Dockerfile
container_name: healthbridge-payment-service
environment:
PORT: 3002
NODE_ENV: production
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_NAME: payments_db
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
GATEWAY_SECRET: ${GATEWAY_SECRET}
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
PAYSTACK_SECRET_KEY: ${PAYSTACK_SECRET_KEY}
PAYSTACK_BASE_URL: https://api.paystack.co
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- healthbridge-network
# ─────────────────────────────────────────
# AI SERVICE
# ─────────────────────────────────────────
ai-service:
build:
context: ./ai-service
dockerfile: Dockerfile
container_name: healthbridge-ai-service
environment:
PORT: 3001
NODE_ENV: production
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_NAME: ai_db
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
GATEWAY_SECRET_KEY: ${GATEWAY_SECRET}
GEMINI_API_KEY: ${GEMINI_API_KEY}
GEMINI_API_URL: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_EXCHANGE: health-bridge-events
REDIS_HOST: redis
REDIS_PORT: 6379
PAYSTACK_SECRET_KEY: ${PAYSTACK_SECRET_KEY}
PAYSTACK_BASE_URL: https://api.paystack.co
FRONTEND_URL: http://frontend:80
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- healthbridge-network
# ─────────────────────────────────────────
# NOTIFICATION SERVICE
# ─────────────────────────────────────────
notification-service:
build:
context: ./notification-service
dockerfile: Dockerfile
container_name: healthbridge-notification-service
environment:
PORT: 2002
NODE_ENV: production
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_NAME: notifications_db
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET}
GATEWAY_SECRET: ${GATEWAY_SECRET}
SENDGRID_API_KEY: ${SENDGRID_API_KEY}
EMAIL_FROM: ${EMAIL_FROM}
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- healthbridge-network
# ─────────────────────────────────────────
# FRONTEND
# ─────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: healthbridge-frontend
ports:
- "80:80"
depends_on:
- api-gateway
networks:
- healthbridge-network
volumes:
postgres_data:
redis_data:
rabbitmq_data:
networks:
healthbridge-network:
driver: bridge