Prometheus - Docker-compose.yml

version: ‘3’

volumes: prom_data: {} graf_data: {}

services: prom: image: prom/prometheus:v2.0.0 ports: - 9090:9090 volumes: - prom_data:/prometheus - ./etc/prometheus:/etc/prometheus network_mode: bridge command: - ‘–config.file=/etc/prometheus/prometheus.yml’ - ‘–storage.tsdb.path=/prometheus’ - ‘–storage.tsdb.retention=5d’

graf:
  image: grafana/grafana
  ports:
    - 3000:3000
  volumes:
    - graf_data:/var/lib/grafana
  network_mode: bridge
  environment:
    - GF_SECURITY_COOKIE_SAMESITE=none
    - GF_SERVER_ROOT_URL=http://x.x.x.x:3000
    - GF_USERS_ALLOW_SIGN_UP=false
    - GF_DASHBOARDS_JSON_ENABLED=true
    - GF_SMTP_ENABLED=true
    - GF_SMTP_HOST=x.x.x:25
    - [email protected]
    - GF_SMTP_SKIP_VERIFY=true

node_exporter:
  image: prom/node-exporter
  ports:
    - 9100:9100
  network_mode: bridge

snmp_exporter:
  image: prom/snmp-exporter
  ports:
    - 9116:9116
  volumes:
    - ./config:/etc/snmp_exporter/
  network_mode: bridge