All tools / Docker Compose examples
Alertmanager with Docker Compose
Prometheus Alertmanager with an inline starter config ready for Slack, email or webhook receivers.
compose.yaml
services:
alertmanager:
image: prom/alertmanager:v0.28.1
restart: unless-stopped
command:
- --config.file=/etc/alertmanager/alertmanager.yml
- --storage.path=/alertmanager
configs:
- source: alertmanager_config
target: /etc/alertmanager/alertmanager.yml
volumes:
- alertmanager-data:/alertmanager
ports:
- "127.0.0.1:9093:9093"
configs:
alertmanager_config:
content: |
route:
receiver: default
group_by: ["alertname"]
repeat_interval: 4h
receivers:
- name: default
# slack_configs:
# - api_url: https://hooks.slack.com/services/...
# channel: "#alerts"
volumes:
alertmanager-data:
How to use it
Commands
docker compose up -d docker compose ps docker compose logs -f
- Add the target alertmanager:9093 under alerting in your Prometheus config.
Prefer Kubernetes? See the Alertmanager Kubernetes version.