-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
199 lines (188 loc) · 4.63 KB
/
docker-compose.yml
File metadata and controls
199 lines (188 loc) · 4.63 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
services:
# Redis
redis:
image: redis:7-alpine
container_name: ticketflow-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- ticketflow-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# PostgreSQL for Event Service
postgres-events:
image: postgres:15-alpine
container_name: ticketflow-postgres-events
environment:
POSTGRES_DB: events
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_events:/var/lib/postgresql/data
networks:
- ticketflow-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 5
# PostgreSQL for Payment Service
postgres-payments:
image: postgres:15-alpine
container_name: ticketflow-postgres-payments
environment:
POSTGRES_DB: payments
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5433:5432"
volumes:
- postgres_payments:/var/lib/postgresql/data
networks:
- ticketflow-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 5
# Event Service
event-service:
build:
context: .
dockerfile: ./services/event-service/Dockerfile
container_name: ticketflow-event-service
environment:
PORT: 3001
DATABASE_URL: postgresql://postgres:postgres@postgres-events:5432/events
REDIS_URL: redis://redis:6379
ports:
- "3001:3001"
depends_on:
postgres-events:
condition: service_healthy
redis:
condition: service_healthy
networks:
- ticketflow-network
restart: unless-stopped
# Ticket Service
ticket-service:
build:
context: .
dockerfile: ./services/ticket-service/Dockerfile
container_name: ticketflow-ticket-service
environment:
PORT: 3002
REDIS_URL: redis://redis:6379
EVENT_SERVICE_URL: http://event-service:3001
PAYMENT_SERVICE_URL: http://payment-service:3003
ports:
- "3002:3002"
depends_on:
redis:
condition: service_healthy
event-service:
condition: service_started
networks:
- ticketflow-network
restart: unless-stopped
# Payment Service
payment-service:
build:
context: .
dockerfile: ./services/payment-service/Dockerfile
container_name: ticketflow-payment-service
environment:
PORT: 3003
DATABASE_URL: postgresql://postgres:postgres@postgres-payments:5432/payments
REDIS_URL: redis://redis:6379
ports:
- "3003:3003"
depends_on:
postgres-payments:
condition: service_healthy
redis:
condition: service_healthy
networks:
- ticketflow-network
restart: unless-stopped
# API Gateway
api-gateway:
build:
context: .
dockerfile: ./services/api-gateway/Dockerfile
container_name: ticketflow-api-gateway
environment:
PORT: 3000
EVENT_SERVICE_URL: http://event-service:3001
TICKET_SERVICE_URL: http://ticket-service:3002
PAYMENT_SERVICE_URL: http://payment-service:3003
ports:
- "3000:3000"
depends_on:
- event-service
- ticket-service
- payment-service
networks:
- ticketflow-network
restart: unless-stopped
# Redis Commander (UI)
redis-commander:
image: rediscommander/redis-commander:latest
container_name: ticketflow-redis-ui
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"
depends_on:
- redis
networks:
- ticketflow-network
profiles:
- monitoring
# Prometheus (Monitoring)
prometheus:
image: prom/prometheus:latest
container_name: ticketflow-prometheus
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- "9090:9090"
networks:
- ticketflow-network
profiles:
- monitoring
# Grafana (Dashboards)
grafana:
image: grafana/grafana:latest
container_name: ticketflow-grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
ports:
- "3030:3000"
depends_on:
- prometheus
networks:
- ticketflow-network
profiles:
- monitoring
networks:
ticketflow-network:
driver: bridge
volumes:
redis_data:
postgres_events:
postgres_payments:
prometheus_data:
grafana_data: