forked from aahil-khan/intellidine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
313 lines (293 loc) · 7.5 KB
/
docker-compose.yml
File metadata and controls
313 lines (293 loc) · 7.5 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
services:
# PostgreSQL
postgres:
image: postgres:15-alpine
container_name: intellidine-postgres
environment:
POSTGRES_DB: intellidine
POSTGRES_USER: admin
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5443:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin"]
interval: 10s
timeout: 5s
retries: 5
networks:
- intellidine-network
# Redis
redis:
image: redis:7-alpine
container_name: intellidine-redis
ports:
- "6380:6379"
volumes:
- redis_data:/data
networks:
- intellidine-network
# Kafka & Zookeeper
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: intellidine-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
networks:
- intellidine-network
kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: intellidine-kafka
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
ports:
- "9092:9092"
networks:
- intellidine-network
# API Gateway
# IMPORTANT: Any service using @shared/auth JwtGuard/JwtModule MUST have JWT_SECRET set
# to the same value as auth-service for JWT verification to work.
api-gateway:
container_name: intellidine-api-gateway
build:
context: ./backend
dockerfile: ./api-gateway/Dockerfile
ports:
- "3100:3100"
environment:
- DATABASE_URL=postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
- REDIS_URL=redis://redis:6379
- KAFKA_BROKER=kafka:9092
- NODE_ENV=development
- AUTH_MODE=${AUTH_MODE:-header}
- JWT_SECRET=${JWT_SECRET}
- PORT=3100
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
kafka:
condition: service_started
networks:
- intellidine-network
restart: unless-stopped
# Auth Service
auth-service:
container_name: intellidine-auth-service
build:
context: ./backend
dockerfile: ./auth-service/Dockerfile
ports:
- "3101:3101"
environment:
- DATABASE_URL=postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
- REDIS_URL=redis://redis:6379
- JWT_SECRET=${JWT_SECRET}
- MSG91_AUTH_KEY=${MSG91_AUTH_KEY}
- NODE_ENV=development
- PORT=3101
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- intellidine-network
restart: unless-stopped
# Order Service
# Order Service
order-service:
container_name: intellidine-order-service
build:
context: ./backend
dockerfile: ./order-service/Dockerfile
ports:
- "3102:3102"
environment:
- DATABASE_URL=postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
- JWT_SECRET=${JWT_SECRET}
- KAFKA_BROKER=kafka:9092
- NODE_ENV=development
- PORT=3102
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_started
networks:
- intellidine-network
restart: unless-stopped
# Menu Service
menu-service:
container_name: intellidine-menu-service
build:
context: ./backend
dockerfile: ./menu-service/Dockerfile
ports:
- "3103:3103"
environment:
- DATABASE_URL=postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
- REDIS_URL=redis://redis:6379
- NODE_ENV=development
- PORT=3103
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- intellidine-network
restart: unless-stopped
# Payment Service
payment-service:
container_name: intellidine-payment-service
build:
context: ./backend
dockerfile: ./payment-service/Dockerfile
ports:
- "3105:3105"
environment:
- DATABASE_URL=postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
- RAZORPAY_KEY_ID=${RAZORPAY_KEY_ID}
- RAZORPAY_KEY_SECRET=${RAZORPAY_KEY_SECRET}
- NODE_ENV=development
- PORT=3105
depends_on:
postgres:
condition: service_healthy
networks:
- intellidine-network
restart: unless-stopped
# Inventory Service
inventory-service:
container_name: intellidine-inventory-service
build:
context: ./backend
dockerfile: ./inventory-service/Dockerfile
ports:
- "3104:3104"
environment:
- DATABASE_URL=postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
- KAFKA_BROKER=kafka:9092
- NODE_ENV=development
- PORT=3104
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_started
networks:
- intellidine-network
restart: unless-stopped
# ML Service
ml-service:
container_name: intellidine-ml-service
build: ./backend/ml-service
ports:
- "8000:8000"
volumes:
- ./backend/ml-service/models:/app/models
networks:
- intellidine-network
restart: unless-stopped
# Prometheus
prometheus:
image: prom/prometheus:latest
container_name: intellidine-prometheus
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- "9090:9090"
networks:
- intellidine-network
restart: unless-stopped
# Grafana
grafana:
image: grafana/grafana:latest
container_name: intellidine-grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
volumes:
- grafana_data:/var/lib/grafana
ports:
- "3009:3000"
networks:
- intellidine-network
restart: unless-stopped
# Notification Service
notification-service:
container_name: intellidine-notification-service
build:
context: ./backend
dockerfile: ./notification-service/Dockerfile
ports:
- "3106:3106"
environment:
- KAFKA_BROKER=kafka:9092
- NODE_ENV=development
- PORT=3106
depends_on:
- kafka
networks:
- intellidine-network
restart: unless-stopped
# Analytics Service
analytics-service:
container_name: intellidine-analytics-service
build:
context: .
dockerfile: backend/analytics-service/Dockerfile
ports:
- "3107:3107"
volumes:
- ./backend/prisma:/app/prisma:ro
environment:
DATABASE_URL: postgresql://admin:${DB_PASSWORD}@postgres:5432/intellidine
KAFKA_BROKER: kafka:9092
NODE_ENV: production
depends_on:
- postgres
- kafka
networks:
- intellidine-network
restart: unless-stopped
# Discount Engine
discount-engine:
container_name: intellidine-discount-engine
build:
context: ./backend
dockerfile: ./discount-engine/Dockerfile
ports:
- "3108:3108"
networks:
- intellidine-network
restart: unless-stopped
# Nginx Reverse Proxy
nginx:
container_name: intellidine-nginx
build: ./infrastructure/nginx
ports:
- "81:80"
# - "443:443" # enable after TLS
depends_on:
- api-gateway
# - frontend # add when frontend is added
networks:
- intellidine-network
restart: unless-stopped
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data:
networks:
intellidine-network:
driver: bridge