forked from kuskoman/logstash-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
123 lines (123 loc) · 3.6 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
version: "3.8"
services:
logstash: &logstash
image: docker.elastic.co/logstash/logstash:8.15.2
restart: unless-stopped
volumes:
- logstash-data:/usr/share/logstash/data
- ./.docker/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
- ./.docker/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
depends_on:
- elasticsearch
healthcheck:
test:
- "CMD"
- "bash"
- "-c"
- 'curl -Ss localhost:9600 | grep -o ''"status":"[a-z]*"'' | awk -F'':'' ''{print $2}'' | grep -q "green" || exit 1'
interval: 30s
timeout: 10s
retries: 8
command: /usr/local/bin/docker-entrypoint --config.reload.automatic
ports:
- ${LOGSTASH_PORT:-5044}:5044
- ${LOGSTASH_STATS_PORT:-9600}:9600
logstash2:
<<: *logstash
ports:
- ${LOGSTASH2_PORT:-5045}:5044
- ${LOGSTASH2_STATS_PORT:-9601}:9600
volumes:
- logstash2-data:/usr/share/logstash/data
- ./.docker/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
- ./.docker/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
prometheus:
image: prom/prometheus:v2.54.1
restart: unless-stopped
volumes:
- prometheus-data:/prometheus
- ./.docker/prometheus.yaml:/etc/prometheus/prometheus.yml:ro
environment:
- PROMETHEUS_PORT=${PROMETHEUS_PORT:-9090}
ports:
- ${PROMETHEUS_PORT:-9090}:9090
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.enable-lifecycle"
- "--web.enable-admin-api"
healthcheck:
test:
- "CMD"
- "sh"
- "-c"
- "wget --no-verbose --tries=1 --spider http://localhost:9090 || exit 1"
interval: 30s
timeout: 10s
retries: 8
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.2
restart: unless-stopped
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
- elasticsearch-logs:/usr/share/elasticsearch/logs
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- xpack.security.transport.ssl.enabled=false
- ES_JAVA_OPTS=-Xms1g -Xmx1g
healthcheck:
test:
- "CMD"
- "curl"
- "-f"
- "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=30s"
interval: 30s
timeout: 10s
retries: 8
ports:
- ${ELASTICSEARCH_PORT:-9200}:9200
grafana:
image: grafana/grafana:11.2.2
restart: unless-stopped
ports:
- ${GRAFANA_PORT:-3000}:3000
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
volumes:
- grafana-data:/var/lib/grafana
- ./.docker/grafana.ini:/etc/grafana/grafana.ini:ro
- ./.docker/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
exporter:
build:
context: .
dockerfile: Dockerfile.dev
healthcheck:
test:
- "CMD"
- "curl"
- "localhost:9198/healthcheck"
- "-f"
interval: 30s
timeout: 10s
retries: 8
volumes:
- .:/app
restart: unless-stopped
environment:
- LOGSTASH_URL=${LOGSTASH_URL:-http://logstash:9600}
- LOG_LEVEL=${LOG_LEVEL:-debug}
- EXPORTER_CONFIG_LOCATION=${EXPORTER_CONFIG_LOCATION:-/app/.docker/exporter-config.yml}
ports:
- ${EXPORTER_PORT:-9198}:9198
volumes:
logstash-data:
logstash2-data:
prometheus-data:
elasticsearch-data:
elasticsearch-logs:
grafana-data: