-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
238 lines (220 loc) · 4.82 KB
/
docker-compose.yml
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
version: "3"
volumes:
prometheus-data:
driver: local
grafana-data:
driver: local
services:
# Guava Cluster (4 Nodes - 1 REST API - 3 RPC) - Mailer Service
# Master Node (exposes REST API)
guava:
container_name: guava
build:
context: ./guava
dockerfile: Dockerfile
hostname: "node0.guava"
environment:
PORT: 7000
MIX_ENV: prod
ENABLE_REST_API: 1
COOKIE: foobar
ERLANG_COOKIE: foobar
RELEASE_NODE: [email protected]
ports:
- '7000:7000'
# 3 Additional Nodes (Master communicates with them via RPC)
guava_1:
container_name: guava_1
build:
context: ./guava
dockerfile: Dockerfile
hostname: "node1.guava"
environment:
PORT: 7001
MIX_ENV: prod
COOKIE: foobar
ERLANG_COOKIE: foobar
RELEASE_NODE: [email protected]
ports:
- '7001:7001'
guava_2:
container_name: guava_2
build:
context: ./guava
dockerfile: Dockerfile
hostname: "node2.guava"
environment:
PORT: 7002
MIX_ENV: prod
COOKIE: foobar
ERLANG_COOKIE: foobar
RELEASE_NODE: [email protected]
ports:
- '7002:7002'
guava_3:
container_name: guava_3
build:
context: ./guava
dockerfile: Dockerfile
hostname: "node3.guava"
environment:
PORT: 7003
MIX_ENV: prod
COOKIE: foobar
ERLANG_COOKIE: foobar
RELEASE_NODE: [email protected]
ports:
- '7003:7003'
prometheus:
container_name: prometheus
image: prom/prometheus:v2.30.3
ports:
- '9090:9090'
volumes:
- ./monitoring/prod/prometheus.yml/:/etc/prometheus/prometheus.yml # config file
- prometheus-data:/prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
ports:
- '3000:3000'
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/prod/grafana/:/etc/grafana/provisioning/
env_file:
- ./monitoring/prod/grafana/.env
depends_on:
- prometheus
# Client Application
client:
container_name: client
build:
context: ./client
dockerfile: Dockerfile
environment:
PORT: 3333
ports:
- '3333:3333'
depends_on:
- acai
# Acai (Gateway)
acai:
container_name: acai
build:
context: ./acai
dockerfile: Dockerfile
ports:
- '4000:4000'
environment:
PORT: 4000
MIX_ENV: prod
depends_on:
- prometheus
- grafana
# Julik (Service Discovery)
julik:
container_name: julik
build:
context: ./julik
dockerfile: Dockerfile
ports:
- '8000:8000'
environment:
PORT: 8000
MIX_ENV: prod
depends_on:
- acai
# Durian (Auth Service)
durian:
container_name: durian
build:
context: ./durian
dockerfile: Dockerfile
ports:
- '5000:5000'
environment:
PORT: 5000
MIX_ENV: prod
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: durian_prod
PGHOST: durian_postgres
PGPORT: 5432
depends_on:
- durian_postgres
- julik
# Nodex (Generator Service)
nodex:
container_name: nodex
build:
context: ./nodex
dockerfile: Dockerfile
ports:
- '9000:9000'
depends_on:
- julik
- durian
# Durian Postgres DB (for Auth Service)
durian_postgres:
container_name: durian_postgres
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: always
# Kiwi (Persist Service)
kiwi:
container_name: kiwi
build:
context: ./kiwi
dockerfile: Dockerfile
ports:
- '6000:6000'
environment:
PORT: 6000
MIX_ENV: prod
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: kiwi_prod
PGHOST: kiwi_postgres
PGPORT: 5432
depends_on:
- kiwi_postgres
- julik
# Kiwi Postgres DB (for Persist Service)
kiwi_postgres:
container_name: kiwi_postgres
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: always
counter_2pc:
container_name: counter_2pc
build:
context: ./counter_2pc
dockerfile: Dockerfile
ports:
- '2000:2000'
environment:
PORT: 2000
MIX_ENV: prod
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: counter_2pc_prod
PGHOST: counter_2pc_postgres
PGPORT: 5432
depends_on:
- counter_2pc_postgres
- julik
# Kiwi Postgres DB (for Persist Service)
counter_2pc_postgres:
container_name: counter_2pc_postgres
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: always