-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·248 lines (233 loc) · 6.45 KB
/
docker-compose.yml
File metadata and controls
executable file
·248 lines (233 loc) · 6.45 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
version: '3.8'
# Production/Full docker-compose file
# Runs all services including Redis and NATS in containers
# Run with: docker-compose up
services:
# Databases
postgres:
image: postgres:15-alpine
container_name: ganaka-postgres
environment:
POSTGRES_DB: ganaka
POSTGRES_USER: ganaka
POSTGRES_PASSWORD: ganaka123
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infrastructure/database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- ganaka-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ganaka -d ganaka"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
container_name: ganaka-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./infrastructure/redis/redis.conf:/etc/redis/redis.conf:ro
command: redis-server /etc/redis/redis.conf
networks:
- ganaka-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Message Broker
nats:
image: nats:2.10-alpine
container_name: ganaka-nats
ports:
- "4222:4222"
- "8222:8222"
volumes:
- ./infrastructure/nats/nats-server.conf:/etc/nats/nats-server.conf:ro
- nats_data:/data
command: ["-c", "/etc/nats/nats-server.conf"]
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- postgres
- redis
# Microservices
auth-service:
build:
context: ./services/auth-service
container_name: ganaka-auth-service
ports:
- "3001:3001"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- REDIS_URL=redis://redis:6379
- NATS_URL=nats://nats:4222
- JWT_SECRET=your-super-secret-jwt-key-change-in-production
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
nats:
condition: service_started
user-service:
build:
context: ./services/user-service
container_name: ganaka-user-service
ports:
- "3002:3002"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- NATS_URL=nats://nats:4222
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- auth-service
expense-service:
build:
context: ./services/expense-service
container_name: ganaka-expense-service
ports:
- "3003:3003"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- NATS_URL=nats://nats:4222
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- user-service
category-service:
build:
context: ./services/category-service
container_name: ganaka-category-service
ports:
- "3004:3004"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- NATS_URL=nats://nats:4222
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- expense-service
report-service:
build:
context: ./services/report-service
container_name: ganaka-report-service
ports:
- "3005:3005"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- NATS_URL=nats://nats:4222
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- category-service
notification-service:
build:
context: ./services/notification-service
container_name: ganaka-notification-service
ports:
- "3006:3006"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- NATS_URL=nats://nats:4222
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USERNAME=noreply@ganaka.com
- SMTP_PASSWORD=your-smtp-password
- FROM_EMAIL=noreply@ganaka.com
- TWILIO_ACCOUNT_SID=your-twilio-account-sid
- TWILIO_AUTH_TOKEN=your-twilio-auth-token
- TWILIO_FROM_NUMBER=+1234567890
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- report-service
dashboard-service:
build:
context: ./services/dashboard-service
container_name: ganaka-dashboard-service
ports:
- "3007:3007"
environment:
- DATABASE_URL=postgres://ganaka:ganaka123@postgres:5432/ganaka
- REDIS_URL=redis://redis:6379
- NATS_URL=nats://nats:4222
- RUST_LOG=info
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- notification-service
# Monitoring and Observability
prometheus:
image: prom/prometheus:latest
container_name: ganaka-prometheus
ports:
- "9090:9090"
volumes:
- ./infrastructure/observability/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
networks:
- ganaka-network
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: ganaka-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana_data:/var/lib/grafana
- ./infrastructure/observability/grafana/provisioning:/etc/grafana/provisioning:ro
- ./infrastructure/observability/grafana/dashboards:/var/lib/grafana/dashboards:ro
networks:
- ganaka-network
restart: unless-stopped
depends_on:
- prometheus
volumes:
postgres_data:
driver: local
redis_data:
driver: local
nats_data:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
networks:
ganaka-network:
driver: bridge
name: ganaka-network