-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
133 lines (121 loc) · 2.64 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
x-common-env: &common-env
NATS_SERVERS: nats://nats:4222
REDIS_HOST: 'redis'
REDIS_PORT: ${REDIS_PORT}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: 'db'
DB_PORT: ${DB_PORT}
OTEL_DEBUG: 'false'
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://otel-collector:4317'
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: 'http://otel-collector:4317'
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: 'http://otel-collector:4317'
services:
nats:
image: nats:alpine
ports:
- '4222:4222'
db:
image: postgres:17-alpine
environment:
POSTGRES_PASSWORD: postgres
volumes:
- ./infra/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 5432:5432
users:
build:
context: .
command:
- pnpm
- run
- start:debug
- users
ports:
- '3000:3000'
- 9229:9229
volumes:
- .:/app
- node_modules:/app/node_modules
depends_on:
- nats
- redis
- db
environment:
SERVICE_NAME: 'users'
<<: [ *common-env ]
books:
build:
context: .
command:
- pnpm
- run
- start:debug
- books
ports:
- '3001:3000'
- '9230:9229'
volumes:
- .:/app
- node_modules:/app/node_modules
depends_on:
- nats
- redis
- db
environment:
SERVICE_NAME: 'books'
<<: [ *common-env ]
k6:
image: grafana/k6:latest
command:
- run
- /opt/browse-books.js
volumes:
- ./k6:/opt
redis:
image: redis:7-alpine
ports:
- '6379:6379'
grafana:
# Default credentials are `admin:admin`
image: grafana/grafana-oss:11.2.2
ports:
- '3030:3000'
volumes:
- './infra/grafana:/etc/grafana'
depends_on:
- prometheus
- otel-collector
- tempo
- loki
prometheus:
image: bitnami/prometheus:2
ports:
- '9090:9090'
command:
- '--web.enable-remote-write-receiver'
- '--config.file=/etc/prometheus/prometheus.yaml'
volumes:
- ./infra/prometheus/:/etc/prometheus/
otel-collector:
image: otel/opentelemetry-collector-contrib:0.111.0
command: [ --config=/etc/otel-collector-config.yaml ]
volumes:
- ./infra/opentelemetry/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- 8080:8889
depends_on:
- prometheus
- tempo
tempo:
image: grafana/tempo:2.6.0
command: [ -config.file=/conf/tempo.yaml ]
volumes:
- ./infra/tempo:/conf
loki:
image: grafana/loki:3.2.0
command: [ '-config.file=/conf/loki.yaml' ]
volumes:
- ./infra/loki:/conf
volumes:
node_modules: