updated docker-compose to be 100% compatible deploying to Swarm

Signed-off-by: Brian Christner <brian.christner@gmail.com>
This commit is contained in:
Brian Christner 2017-10-18 20:51:11 +02:00
parent cd6a0350b3
commit 07cf41bae6
No known key found for this signature in database
GPG Key ID: 8453AD0CB29591D1
1 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
version: '3'
version: '3.2'
volumes:
prometheus_data: {}
@ -9,6 +9,7 @@ networks:
back-tier:
services:
prometheus:
image: prom/prometheus
volumes:
@ -35,18 +36,24 @@ services:
deploy:
placement:
constraints:
- node.hostname == <hostname where the prometheus config files are located>
- node.hostname == moby
node-exporter:
image: prom/node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- type: bind
source: /proc
target: /host/proc
- type: bind
source: /sys
target: /host/sys
- type: bind
source: /
target: /rootfs
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points="^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)"'
- '--collector.filesystem.ignored-fs-types="^(sys|proc|auto|cgroup|devpts|ns|au|fuse\.lxc|mqueue)(fs|)$$"'
- '--collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)"'
expose:
- 9100
networks:
@ -54,6 +61,7 @@ services:
restart: always
deploy:
mode: global
alertmanager:
image: prom/alertmanager
ports:
@ -69,7 +77,7 @@ services:
deploy:
placement:
constraints:
- node.hostname == <hostname where alertmanager config files are located>
- node.hostname == moby
cadvisor:
image: google/cadvisor
volumes: