-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
141 lines (127 loc) · 3.68 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
services:
postgres:
image: postgis/postgis:16-3.4-alpine
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- "${DB_PORT}:${DB_PORT}"
volumes:
- data-volume:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "root", "-d", "postgres"]
interval: 10s
timeout: 5s
retries: 5
pgadmin4:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=user@domain.com
- PGADMIN_DEFAULT_PASSWORD=SuperSecret
ports:
- "80:80"
redis:
image: redis:7-alpine
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: Dockerfile
ports:
- ${HTTP_SERVER_PORT}:${HTTP_SERVER_PORT}
- ${GRPC_SERVER_PORT}:${GRPC_SERVER_PORT}
environment:
- DB_SOURCE=postgresql://root:secret@postgres:5432/eenergy?sslmode=disable
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME
depends_on:
postgres: # Wait for postgres to start
condition: service_healthy # Only start after postgres is healthy
redis: # Wait for redis to start
condition: service_healthy # Only start after redis is healthy
otel-collector:
condition: service_started
# logs containers
loki:
image: grafana/loki:latest
ports:
- "3100:3100"
- "9095:9095"
command: -config.file=/etc/loki/local-config.yaml -print-config-stderr
volumes:
- ./cfg/loki/loki-config.yaml:/etc/loki/local-config.yaml
- ./cfg/loki/rules:/loki/rules/fake
alertmanager:
image: prom/alertmanager:latest
volumes:
- ./cfg/alertmanager.yml:/etc/alertmanager/alertmanager.yml
ports:
- "9093:9093"
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
depends_on:
- prometheus
promtail:
image: grafana/promtail:latest
volumes:
- ./cfg/promtail-config.yml:/etc/promtail/promtail.yml
- /var/log:/var/log
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/promtail.yml
depends_on:
- loki
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./cfg/grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
depends_on:
- loki
- prometheus
- jaeger
# metrics containers
prometheus:
image: prom/prometheus:latest
volumes:
- ./cfg/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./cfg/prometheus/alert_rules.yml:/etc/prometheus/alert_rules.yml
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
# traces containes
# Jaeger
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "${JAEGER_SERVICE_PORT}" # Jaeger UI
- "${OTEL_COLLECTOR_PORT_GRPC}"
environment:
- COLLECTOR_OTLP_ENABLED=true
otel-collector:
image: otel/opentelemetry-collector-contrib
volumes:
- ./cfg/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 13133:13133 # health_check extension
- 55679:55679 # zpages extension
- "${OTEL_COLLECTOR_PORT_GRPC}"
- "${OTEL_COLLECTOR_PORT_HTTP}"
depends_on:
- jaeger
- prometheus
volumes:
data-volume:
grafana-data: