Add Promtail to ship Docker container logs to Loki

Loki was running but had no log shipper — no labels or logs were
visible in Grafana. Adds Promtail to scrape all Docker container
logs and push them to Loki.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-05 15:23:41 +02:00
parent 38565f8cc2
commit 5a19217b33
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
2 changed files with 33 additions and 0 deletions

View file

@ -128,6 +128,17 @@ services:
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
promtail:
image: grafana/promtail:latest
restart: unless-stopped
volumes:
- /var/log:/var/log:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- ./promtail/promtail-config.yml:/etc/promtail/config.yml:ro
command: ["-config.file=/etc/promtail/config.yml"]
depends_on:
- loki
prometheus:
image: prom/prometheus:latest
restart: unless-stopped