Add restart policy

It's almost no possible monitoring solution which it's OK to stop monitoring server itself upon a problem.

Signed-off-by: Amin Vakil <info@aminvakil.com>
This commit is contained in:
Amin Vakil 2020-04-09 17:26:45 +04:30
parent d3c5f28243
commit e6a62bc91c

View File

@ -7,6 +7,8 @@ services:
- '--config.file=/etc/prometheus/prometheus.yml' - '--config.file=/etc/prometheus/prometheus.yml'
ports: ports:
- 9090:9090 - 9090:9090
restart:
- unless-stopped
volumes: volumes:
- ./prometheus:/etc/prometheus - ./prometheus:/etc/prometheus
- prom_data:/prometheus - prom_data:/prometheus
@ -15,6 +17,8 @@ services:
container_name: grafana container_name: grafana
ports: ports:
- 3000:3000 - 3000:3000
restart:
- unless-stopped
environment: environment:
- GF_SECURITY_ADMIN_USER=admin - GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana - GF_SECURITY_ADMIN_PASSWORD=grafana