forked from EvilMurlok/simpleServerMonitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
101 lines (94 loc) · 2.32 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
version: '3.9'
networks:
monitoring:
driver: bridge
volumes:
postgres_data: {}
services:
server:
container_name: server_monitoring
build:
context: .
restart: on-failure
working_dir: "/app"
ports:
- "9000:9000"
depends_on:
- postgres
volumes:
- ".:/app"
- "/app/node_modules"
networks:
- monitoring
postgres:
container_name: postgres
image: 'postgres'
ports:
- '5432:5432'
environment:
POSTGRES_DB: 'monitoring'
POSTGRES_USER: 'root'
POSTGRES_PASSWORD: '123456'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U root -d monitoring" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 4G
networks:
- monitoring
postgres_exporter:
container_name: exporter
image: prometheuscommunity/postgres-exporter:v0.10.0
environment:
DATA_SOURCE_URI: "postgres:5432/monitoring?sslmode=disable"
DATA_SOURCE_USER: "root"
DATA_SOURCE_PASS: "123456"
PG_EXPORTER_EXTEND_QUERY_PATH: "/etc/postgres_exporter/queries.yaml"
volumes:
- ./queries.yaml:/etc/postgres_exporter/queries.yaml:ro
ports:
- "9187:9187"
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.2'
memory: 500M
networks:
- monitoring
grafana:
container_name: grafana
image: grafana/grafana
volumes:
- ./monitoring/grafana/data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
ports:
- "3000:3000"
networks:
- monitoring
prometheus:
image: prom/prometheus
container_name: prometheus
restart: unless-stopped
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./monitoring/prometheus/data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
networks:
- monitoring