-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
97 lines (89 loc) · 2.15 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
97 lines (89 loc) · 2.15 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
version: '3.0'
services:
#1.prometheus
prometheus:
image: prom/prometheus
container_name: prometheus
restart: always
volumes:
- $PWD/config/prometheus.yml:/etc/prometheus/prometheus.yml
- $PWD/config/rules:/etc/prometheus/rules
# - $PWD/config/targets:/etc/prometheus/targets
command:
- --web.enable-lifecycle
- --config.file=/etc/prometheus/prometheus.yml
ports:
- 9090:9090
networks:
- webapp
environment:
- TZ=Asia/Shanghai
#2.alertmanager
alertmanager:
image: prom/alertmanager
container_name: alertmanager
restart: always
volumes:
- $PWD/config/alertmanager.yml:/etc/alertmanager/alertmanager.yml
# - $PWD/config/template:/alertmanager/template
ports:
- 9093:9093
networks:
- webapp
environment:
- TZ=Australia/Sydney
#3.cadvisor | use mon-net as different network to support MacOS
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.49.1
container_name: cadvisor
privileged: true
ports:
- "8080:8080"
networks:
- mon-net
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
devices:
- /dev/kmsg
restart: unless-stopped
webapp:
build:
context: .
dockerfile: Dockerfile
networks:
- webapp
deploy:
replicas: 2
resources:
limits:
cpus: '0.5'
memory: 60M
reservations:
cpus: '0.1'
memory: 6M
nginx:
image: nginx:latest
networks:
- webapp
ports:
- "8088:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
# nginx-prometheus-exporter:
# image: nginx/nginx-prometheus-exporter:latest
# networks:
# - webapp
# ports:
# - "9113:9113"
# command: --nginx.scrape-uri=http://nginx:80/stub_status
# depends_on:
# - nginx
networks:
webapp:
driver: bridge
mon-net:
driver: bridge