-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathdocker-compose.metrics.yml
More file actions
109 lines (102 loc) · 2.83 KB
/
docker-compose.metrics.yml
File metadata and controls
109 lines (102 loc) · 2.83 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
version: '2'
x-restart-policy: &restart-policy "no"
services:
dns:
image: lancachenet/lancache-dns:latest
env_file: .env
restart: *restart-policy
ports:
- ${DNS_BIND_IP}:53:53/udp
- ${DNS_BIND_IP}:53:53/tcp
labels:
lancache.dns: "true"
healthcheck:
test: ["CMD", "dig", "+norecurse", "+short" ,"+retry=0", "@127.0.0.1", "lancache.net"]
interval: 10s
timeout: 5s
retries: 5
networks:
default:
dns-metrics:
aliases:
- lancache-dns
## HTTPS requests are now handled in monolithic directly
## you could choose to return to sniproxy if desired
#
# sniproxy:
# image: lancachenet/sniproxy:latest
# env_file: .env
# restart: *restart-policy
# ports:
# - 443:443/tcp
monolithic:
image: lancachenet/monolithic:latest
env_file: .env
restart: *restart-policy
ports:
- 80:80/tcp
- 443:443/tcp
volumes:
- ${CACHE_ROOT}/cache:/data/cache
- ${CACHE_ROOT}/logs:/data/logs
labels:
lancache.monolithic: "true"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/nginx_status"]
interval: 10s
timeout: 5s
retries: 5
networks:
default:
monolithic-metrics:
aliases:
- lancache-monolithic
## Metrics exporter for DNS and Monolithic
## This can be disabled, if you don't want to export metrics to prometheus
## To disable, comment out the next two services
dns-metrics:
image: prometheuscommunity/bind-exporter:v0.3.0
restart: *restart-policy
command:
- --web.listen-address=:9119 # This is the port the exporter will listen on
- --bind.stats-url=http://lancache-dns:8053
ports:
- ${METRIC_BIND_IP:-${DNS_BIND_IP}}:9119:9119
labels:
lancache.dns.metrics: "true"
depends_on:
dns:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:9119/metrics"]
interval: 10s
timeout: 5s
retries: 5
networks:
dns-metrics:
aliases:
- bind-exporter
monolithic-metrics:
image: nginx/nginx-prometheus-exporter:0.10.0
restart: *restart-policy
command:
- --nginx.scrape-uri=http://lancache-monolithic:8080/nginx_status
ports:
- ${METRIC_BIND_IP:-${DNS_BIND_IP}}:9113:9113
labels:
lancache.monolithic.metrics: "true"
depends_on:
monolithic:
condition: service_healthy
# healthcheck:
# Healthcheck cannot be done on image, as it is a scratch image
# Without any healthcheck functionality
networks:
monolithic-metrics:
aliases:
- monolithic-exporter
## Network definitions, do not change these, unless you know what you are doing
networks:
default:
dns-metrics:
monolithic-metrics: