-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
367 lines (362 loc) · 10.3 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
version: "3.8"
services:
#
# docker compose --profile monolith up
#
monolith:
container_name: monolith
platform: linux/arm64/v8
hostname: monolith
image: intellimall-monolith
build:
context: .
dockerfile: docker/Dockerfile
ports:
- '8080:8080'
- '8085:8085'
env_file:
- docker/.env
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/monolith" ]
profiles: [ monolith ]
#
# docker compose --profile microservices up
#
baskets:
container_name: baskets
platform: linux/arm64/v8
hostname: baskets
image: intellimall-baskets
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: baskets
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=baskets user=baskets_user password=baskets_pass search_path=baskets,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: baskets
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles: [ microservices ]
cosec:
container_name: cosec
platform: linux/arm64/v8
hostname: cosec
image: intellimall-cosec
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: cosec
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=cosec user=cosec_user password=cosec_pass search_path=cosec,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: cosec
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
customers:
container_name: customers
platform: linux/arm64/v8
hostname: customers
image: intellimall-customers
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: customers
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=customers user=customers_user password=customers_pass search_path=customers,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: customers
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
depot:
container_name: depot
platform: linux/arm64/v8
hostname: depot
image: intellimall-depot
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: depot
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=depot user=depot_user password=depot_pass search_path=depot,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: depot
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
notifications:
container_name: notifications
platform: linux/arm64/v8
hostname: notifications
image: intellimall-notifications
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: notifications
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=notifications user=notifications_user password=notifications_pass search_path=notifications,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: notifications
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
ordering:
container_name: ordering
platform: linux/arm64/v8
hostname: ordering
image: intellimall-ordering
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: ordering
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=ordering user=ordering_user password=ordering_pass search_path=ordering,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: ordering
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
payments:
container_name: payments
platform: linux/arm64/v8
hostname: payments
image: intellimall-payments
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: payments
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=payments user=payments_user password=payments_pass search_path=payments,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: payments
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
search:
container_name: search
hostname: search
image: intellimall-search
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: search
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=search user=search_user password=search_pass search_path=search,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: search
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
stores:
container_name: stores
platform: linux/arm64/v8
hostname: stores
image: intellimall-stores
build:
context: .
dockerfile: docker/Dockerfile.microservices
args:
service: stores
expose:
- '9000'
environment:
ENVIRONMENT: development
RPC_SERVICES: 'STORES=stores:9000,CUSTOMERS=customers:9000'
PG_CONN: host=postgres dbname=stores user=stores_user password=stores_pass search_path=stores,public
NATS_URL: nats:4222
OTEL_SERVICE_NAME: stores
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4317
depends_on:
- nats
- postgres
- collector
command: [ "./wait-for", "postgres:5432", "--", "/intellimall/service" ]
profiles:
- microservices
reverse-proxy:
container_name: proxy
hostname: proxy
image: nginxproxy/nginx-proxy:alpine
ports:
- '8080:8080'
volumes:
- './docker/nginx.conf:/etc/nginx/nginx.conf'
- /var/run/docker.sock:/tmp/docker.sock:ro
profiles:
- microservices
postgres:
container_name: postgres
platform: linux/arm64/v8
hostname: postgres
image: postgres:14-alpine
restart: always
environment:
POSTGRES_PASSWORD: itsasecret
ports:
- '5432:5432'
volumes:
- 'pgdata:/var/lib/postgresql/data'
- './docker/database:/docker-entrypoint-initdb.d'
nats:
container_name: nats
platform: linux/arm64/v8
hostname: nats
image: nats:2-alpine
ports:
- '4222:4222'
command:
- -js
- -sd
- /var/lib/nats/data
volumes:
- 'jsdata:/var/lib/nats/data'
pact:
container_name: pact
platform: linux/arm64/v8
hostname: pact
image: pactfoundation/pact-broker:latest-multi
ports:
- "9292:9292"
depends_on:
- postgres
environment:
PACT_BROKER_DATABASE_URL: 'postgres://pactuser:pactpass@postgres/pactdb'
PACT_BROKER_BASIC_AUTH_USERNAME: pactuser
PACT_BROKER_BASIC_AUTH_PASSWORD: pactpass
PACT_BROKER_ALLOW_PUBLIC_READ: 'true'
PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES: 5
PACT_BROKER_BASE_URL: 'http://localhost:9292 http://pact-broker:9292'
collector:
container_name: collector
hostname: collector
image: otel/opentelemetry-collector-contrib:0.60.0
command: [
"--config=/etc/otel-config.yml",
]
volumes:
- ./docker/otel/otel-config.yml:/etc/otel-config.yml
ports:
- "1888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP http receiver
# - "55679:55679" # zpages extension
jaeger:
container_name: jaeger
platform: linux/arm64/v8
hostname: jaeger
image: jaegertracing/all-in-one:latest
ports:
- "8081:16686"
- "14250"
prometheus:
container_name: prometheus
platform: linux/arm64/v8
hostname: prometheus
image: prom/prometheus:v2.37.1
command: [
"--config.file=/etc/prometheus/prometheus-config.yml",
]
volumes:
- ./docker/prometheus/prometheus-config.yml:/etc/prometheus/prometheus-config.yml
ports:
- "9090:9090"
grafana:
container_name: grafana
platform: linux/arm64/v8
hostname: grafana
image: grafana/grafana:9.0.9
volumes:
- ./docker/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./docker/grafana/provisioning/:/etc/grafana/provisioning/
ports:
- "3000:3000"
volumes:
pgdata:
jsdata: