Update docker-compose.yml
This commit is contained in:
@@ -1,11 +1,16 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
# =========================
|
||||||
|
# Prometheus
|
||||||
|
# =========================
|
||||||
prometheus:
|
prometheus:
|
||||||
image: prom/prometheus:latest
|
image: prom/prometheus:latest
|
||||||
container_name: prometheus
|
container_name: prometheus
|
||||||
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||||
|
- ./prometheus/alert.rules.yml:/etc/prometheus/alert.rules.yml:ro
|
||||||
- prometheus_data:/prometheus
|
- prometheus_data:/prometheus
|
||||||
command:
|
command:
|
||||||
- "--config.file=/etc/prometheus/prometheus.yml"
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
||||||
@@ -16,15 +21,17 @@ services:
|
|||||||
- "9090:9090"
|
- "9090:9090"
|
||||||
networks:
|
networks:
|
||||||
- monitoring
|
- monitoring
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Grafana
|
||||||
|
# =========================
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana-oss:latest
|
image: grafana/grafana-oss:latest
|
||||||
container_name: grafana
|
container_name: grafana
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- GF_SECURITY_ADMIN_USER=admin
|
- GF_SECURITY_ADMIN_USER=admin
|
||||||
- GF_SECURITY_ADMIN_PASSWORD=admin
|
- GF_SECURITY_ADMIN_PASSWORD=admin
|
||||||
# optional but handy
|
|
||||||
- GF_SERVER_DOMAIN=localhost
|
- GF_SERVER_DOMAIN=localhost
|
||||||
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/
|
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/
|
||||||
volumes:
|
volumes:
|
||||||
@@ -35,7 +42,73 @@ services:
|
|||||||
- monitoring
|
- monitoring
|
||||||
depends_on:
|
depends_on:
|
||||||
- prometheus
|
- prometheus
|
||||||
|
- loki
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Alertmanager
|
||||||
|
# =========================
|
||||||
|
alertmanager:
|
||||||
|
image: prom/alertmanager:latest
|
||||||
|
container_name: alertmanager
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
|
||||||
|
command:
|
||||||
|
- "--config.file=/etc/alertmanager/alertmanager.yml"
|
||||||
|
ports:
|
||||||
|
- "9093:9093"
|
||||||
|
networks:
|
||||||
|
- monitoring
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Blackbox exporter
|
||||||
|
# =========================
|
||||||
|
blackbox-exporter:
|
||||||
|
image: prom/blackbox-exporter:latest
|
||||||
|
container_name: blackbox-exporter
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./blackbox/blackbox.yml:/etc/blackbox_exporter/config.yml:ro
|
||||||
|
command:
|
||||||
|
- "--config.file=/etc/blackbox_exporter/config.yml"
|
||||||
|
ports:
|
||||||
|
- "9115:9115"
|
||||||
|
networks:
|
||||||
|
- monitoring
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Loki (logs backend)
|
||||||
|
# =========================
|
||||||
|
loki:
|
||||||
|
image: grafana/loki:latest
|
||||||
|
container_name: loki
|
||||||
|
restart: unless-stopped
|
||||||
|
command: -config.file=/etc/loki/local-config.yml
|
||||||
|
volumes:
|
||||||
|
- ./loki/loki-config.yml:/etc/loki/local-config.yml:ro
|
||||||
|
- loki_data:/loki
|
||||||
|
ports:
|
||||||
|
- "3100:3100"
|
||||||
|
networks:
|
||||||
|
- monitoring
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Promtail (log shipper from this host)
|
||||||
|
# =========================
|
||||||
|
promtail:
|
||||||
|
image: grafana/promtail:latest
|
||||||
|
container_name: promtail
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./promtail/promtail-config.yml:/etc/promtail/config.yml:ro
|
||||||
|
- /var/log:/var/log:ro
|
||||||
|
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
||||||
|
- /etc/machine-id:/etc/machine-id:ro
|
||||||
|
command: -config.file=/etc/promtail/config.yml
|
||||||
|
networks:
|
||||||
|
- monitoring
|
||||||
|
depends_on:
|
||||||
|
- loki
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
monitoring:
|
monitoring:
|
||||||
@@ -43,3 +116,4 @@ networks:
|
|||||||
volumes:
|
volumes:
|
||||||
prometheus_data:
|
prometheus_data:
|
||||||
grafana_data:
|
grafana_data:
|
||||||
|
loki_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user