This repository was archived by the owner on Jul 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
214 lines (205 loc) · 5.28 KB
/
docker-compose.yml
File metadata and controls
214 lines (205 loc) · 5.28 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
x-common: &common
networks:
- person-network
restart: unless-stopped
services:
person-api:
!!merge <<: *common
build: .
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
fluent-bit:
condition: service_started
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/persondb
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4318
- OTEL_SERVICE_NAME=person-api
- OTEL_TRACES_EXPORTER=otlp
- OTEL_METRICS_EXPORTER=none
- OTEL_LOGS_EXPORTER=none
- OTEL_RESOURCE_ATTRIBUTES=api=person-api
- MANAGEMENT_METRICS_TAGS_APPLICATION=person-api
- JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=70.0 -XX:InitialRAMPercentage=50.0 -XX:+UseG1GC -XX:+UseContainerSupport -XX:+ExitOnOutOfMemoryError
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
logging:
driver: fluentd
options:
fluentd-address: 127.0.0.1:24224
postgres:
!!merge <<: *common
image: postgres:17-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_DB=persondb
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres-data:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
loki:
!!merge <<: *common
image: grafana/loki:3.4.2
command: -config.file=/etc/loki/local-config.yaml
ports:
- "3100:3100"
volumes:
- ./etc/loki/loki.yaml:/etc/loki/local-config.yaml
- loki-data:/loki
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.1'
memory: 64M
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
fluent-bit:
!!merge <<: *common
image: grafana/fluent-bit-plugin-loki:3.2.1
container_name: fluent-bit
ports:
- "24224:24224"
environment:
- LOKI_URL=http://loki:3100/loki/api/v1/push
volumes:
- ./etc/fluent-bit/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
depends_on:
loki:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.25'
memory: 64M
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 24224 || exit 1" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
prometheus:
!!merge <<: *common
image: prom/prometheus:v2.53.4
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
ports:
- "9090:9090"
volumes:
- ./etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:9090/-/healthy || exit 1" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
tempo:
!!merge <<: *common
image: grafana/tempo:2.7.1
command: -config.file /etc/tempo-config.yml
ports:
- "3200:3200"
- "4317:4317"
- "4318:4318"
volumes:
- ./etc/tempo/tempo.yml:/etc/tempo-config.yml
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.1'
memory: 64M
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3200/ready || exit 1" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
grafana:
!!merge <<: *common
image: grafana/grafana:11.5.2
ports:
- "3000:3000"
volumes:
- ./etc/grafana/:/etc/grafana/provisioning/datasources
- ./etc/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./etc/dashboards:/etc/grafana/dashboards
depends_on:
loki:
condition: service_healthy
prometheus:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.1'
memory: 64M
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
person-network:
name: person-network
driver: bridge
volumes:
postgres-data:
prometheus-data:
loki-data: