-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
230 lines (202 loc) · 5.04 KB
/
docker-compose.yaml
File metadata and controls
230 lines (202 loc) · 5.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
services:
api-gateway:
build: ./ApiGateway
container_name: truebank_api_gateway
ports:
- "8080:8080"
depends_on:
- auth-service
- user-service
- transaction-service
env_file:
- ./ApiGateway/.env
networks:
- monitoring
auth-service:
build: ./TrueBankAuth
container_name: truebank_auth_service
ports:
- "7070:7070"
- "50051:50051"
depends_on:
postgres-auth:
condition: service_healthy
networks:
- monitoring
env_file:
- ./TrueBankAuth/.env
volumes:
- ./TrueBankAuth/.env:/app/.env
user-service:
build: ./TrueBankUserService
container_name: truebank_user_service
ports:
- "5050:5050"
- "50052:50052"
depends_on:
postgres-users:
condition: service_healthy
redis:
condition: service_started
kafka:
condition: service_started
networks:
- monitoring
env_file:
- ./TrueBankUserService/.env
volumes:
- ./TrueBankUserService/.env:/app/.env
transaction-service:
build: ./TrueBankTransactionService
container_name: truebank_transaction_service
ports:
- "6060:6060"
- "50053:50053"
depends_on:
postgres-transaction:
condition: service_healthy
kafka:
condition: service_started
networks:
- monitoring
env_file:
- ./TrueBankTransactionService/.env
volumes:
- ./TrueBankTransactionService/.env:/app/.env
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: truebank_zookeeper
restart: always
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
networks:
- monitoring
kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: truebank_kafka
restart: always
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
ports:
- "9092:9092"
networks:
- monitoring
postgres-auth:
image: postgres:15
container_name: postgres-server-auth
environment:
POSTGRES_USER: true-server
POSTGRES_PASSWORD: true123
POSTGRES_DB: true_db_auth
ports:
- "5432:5432"
volumes:
- postgres_auth:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U true-server -d true_db_auth" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- monitoring
postgres-transaction:
image: postgres:15
container_name: postgres-server-server
environment:
POSTGRES_USER: true-server
POSTGRES_PASSWORD: true123
POSTGRES_DB: true_db_transaction
ports:
- "5433:5432"
volumes:
- postgres_transaction:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U true-server -d true_db_transaction -h localhost" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- monitoring
postgres-users:
image: postgres:15
container_name: postgres-server-user
environment:
POSTGRES_USER: true-server
POSTGRES_PASSWORD: true123
POSTGRES_DB: true_db_user
ports:
- "5434:5432"
volumes:
- postgres_user:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U true-server -d true_db_user -h localhost" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- monitoring
redis:
image: redis:7.2
container_name: redis_cache
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: always
prometheus:
image: prom/prometheus
volumes:
- ./monitoring/prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- monitoring
grafana:
image: grafana/grafana
ports:
- "9000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
networks:
- monitoring
loki:
image: grafana/loki:3.0.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/loki-config.yaml
volumes:
- ./monitoring/loki-config.yaml:/etc/loki/loki-config.yaml
networks:
- monitoring
promtail:
image: grafana/promtail:3.0.0
volumes:
- ./monitoring/promtail-config.yaml:/etc/promtail/promtail-config.yaml
- /var/log:/var/log
- /var/lib/docker/containers:/var/lib/docker/containers
command: -config.file=/etc/promtail/promtail-config.yaml
networks:
- monitoring
volumes:
postgres_auth:
postgres_transaction:
postgres_user:
redis_data:
grafana-data:
networks:
monitoring: