-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
100 lines (90 loc) · 2.59 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
services:
# Core Service
web:
profiles: ["prod"]
image: aimeric/axum-demo:latest
#build: .
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8080/health/live || exit 1
interval: 30s
timeout: 5s
retries: 5
start_period: 5s
ports:
- 8080:8080
environment:
SERVICE_DB_HOST: "db"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
env_file:
- .env
depends_on:
db:
condition: service_healthy
# Dependent Service
db:
profiles: ["dev", "prod"]
image: postgres:15
user: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 10
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: "welcome"
POSTGRES_DB: "app_db"
# Telemetry Components
otel-collector:
profiles: ["dev", "prod"]
image: otel/opentelemetry-collector-contrib:0.86.0
# healthcheck:
# test: wget --no-verbose --tries=1 --spider http://localhost:13133 || exit 1
volumes:
- ./infrastructure/docker-compose/otel/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 13133:13133 # health_check extension
- 8888:8888 # Prometheus metrics exposed by the collector
- 8889:8889 # Prometheus exporter metrics
- 4317:4317 # OTLP gRPC receiver
prometheus:
profiles: ["dev", "prod"]
image: prom/prometheus:v2.47.0
ports:
- 9090:9090
- 1234:1234
command:
- --web.enable-remote-write-receiver
- --enable-feature=native-histograms
#- --enable-feature=otlp-write-receiver
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./infrastructure/docker-compose/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
jaeger:
profiles: ["dev", "prod"]
image: jaegertracing/all-in-one:1.49
ports:
- 16686:16686 # Web UI
- 14250:14250 # Listen for traces
grafana:
profiles: ["dev", "prod"]
image: grafana/grafana:10.1.2
ports:
- 3000:3000
environment:
GF_USERS_DEFAULT_THEME: "light"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_BASIC_ENABLED: "false"
volumes:
- ./infrastructure/docker-compose/grafana:/etc/grafana/provisioning
# Tests
k6:
profiles: ["load-test"]
image: grafana/k6:0.46.0
environment:
K6_PROMETHEUS_RW_SERVER_URL: "http://prometheus:9090/api/v1/write"
K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM: "true"
volumes:
- ./infrastructure/docker-compose/k6:/scripts