-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
197 lines (180 loc) · 4.44 KB
/
docker-compose.yaml
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
version: '3.8'
services:
api-1:
image: evergreen-stores-api
build:
context: api
dockerfile: Dockerfile
container_name: api-1
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.2
ports:
- "5000:5000"
env_file:
- .env
environment:
- HOST=172.20.0.2
- PORT=5000
restart: unless-stopped
api-2:
image: evergreen-stores-api
container_name: api-2
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.3
ports:
- "5001:5001"
env_file:
- .env
environment:
- HOST=172.20.0.3
- PORT=5001
depends_on:
- api-1
restart: unless-stopped
load-balancer:
image: nginx:1.25.0-alpine
container_name: nginx
hostname: nginx
volumes:
- ./load-balancer/nginx.conf:/etc/nginx/nginx.conf
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.4
ports:
- "8080:8080"
depends_on:
- api-1
- api-2
restart: unless-stopped
redis-master:
image: redis:7.0-alpine
container_name: redis-master
hostname: redis-master
volumes:
- evergreen-stores-database:/data/
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.5
ports:
- "6379:6379"
restart: unless-stopped
redis-slave-1:
image: redis:7.0-alpine
container_name: redis-slave-1
hostname: redis-slave-1
command: redis-server --slaveof redis-master 6379
links:
- redis-master
volumes:
- evergreen-stores-database:/data/
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.6
restart: unless-stopped
redis-slave-2:
image: redis:7.0-alpine
container_name: redis-slave-2
hostname: redis-slave-2
command: redis-server --slaveof redis-master 6379
links:
- redis-master
volumes:
- evergreen-stores-database:/data/
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.7
restart: unless-stopped
redis-sentinel-1:
image: redis-sentinel
build:
context: database/redis-sentinel
dockerfile: Dockerfile
container_name: redis-sentinel-1
hostname: redis-sentinel-1
links:
- redis-master
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.8
restart: unless-stopped
redis-sentinel-2:
image: redis-sentinel
container_name: redis-sentinel-2
hostname: redis-sentinel-2
links:
- redis-master
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.9
depends_on:
- redis-sentinel-1
restart: unless-stopped
redis-sentinel-3:
image: redis-sentinel
container_name: redis-sentinel-3
hostname: redis-sentinel-3
links:
- redis-master
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.10
depends_on:
- redis-sentinel-1
restart: unless-stopped
prometheus:
image: prom/prometheus:latest
container_name: prometheus
hostname: prometheus
volumes:
- evergreen-stores-monitoring-metrics:/prometheus
- ./monitoring/prometheus.yaml:/etc/prometheus/prometheus.yaml
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.11
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: grafana
hostname: grafana
volumes:
- evergreen-stores-monitoring-visualization:/var/lib/grafana
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.12
ports:
- "3000:3000"
depends_on:
- prometheus
restart: unless-stopped
redis-master-monitoring-adapter:
image: "redislabs/prometheus-redistimeseries-adapter:master"
container_name: redis-master-monitoring-adapter
hostname: redis-master-monitoring-adapter
command: ["-redis-address", "172.20.0.5:6379", "-web.listen-address", "172.20.0.13:9201"]
networks:
evergreen-stores-network:
ipv4_address: 172.20.0.13
ports:
- "9201:9201"
depends_on:
- prometheus
- redis-master
restart: unless-stopped
volumes:
evergreen-stores-database:
external: true
evergreen-stores-monitoring-metrics:
external: true
evergreen-stores-monitoring-visualization:
external: true
networks:
evergreen-stores-network:
ipam:
config:
- subnet: 172.20.0.0/24