Skip to content

Instantly share code, notes, and snippets.

@jonathanmach
Created March 2, 2026 16:10
Show Gist options
  • Select an option

  • Save jonathanmach/8cf5979f185d27e08ec5858caf52b6c8 to your computer and use it in GitHub Desktop.

Select an option

Save jonathanmach/8cf5979f185d27e08ec5858caf52b6c8 to your computer and use it in GitHub Desktop.
Grafana setup
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.retention.time=30d
ports:
- "9092:9090"
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
ports:
- "3002:3000"
restart: unless-stopped
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
# Important: mount host paths so you get real host metrics
pid: host
network_mode: host
command:
- --path.rootfs=/host
- --collector.processes
volumes:
- /:/host:ro,rslave
restart: unless-stopped
volumes:
prometheus_data:
grafana_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment