Skip to content

Instantly share code, notes, and snippets.

@tanmay-bhat
Created March 26, 2022 11:09
Show Gist options
  • Save tanmay-bhat/48a26efb5fb5de2995cbe7906829e1e6 to your computer and use it in GitHub Desktop.
Save tanmay-bhat/48a26efb5fb5de2995cbe7906829e1e6 to your computer and use it in GitHub Desktop.
Simple Docker compose file to start Prometheus server along with node-exporter
version: '3.8'
services:
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
ports:
- 9100:9100
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- 9090:9090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment