version: '3' services: # Database, Scraper prometheus: image: prom/prometheus ports: - 9090:9090 volumes: - prometheus-data:/prometheus # This volume stores the actual Prometheus data - ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml command: - --config.file=/etc/prometheus/prometheus.yml - --enable-feature=exemplar-storage # Web UI grafana: image: grafana/grafana restart: unless-stopped ports: - 3001:3000 environment: - GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER} - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD} - GF_USERS_ALLOW_SIGN_UP=false volumes: - grafana-data:/var/lib/grafana # This volume stores Grafana's data - ./docker/grafana/datasources/:/etc/grafana/provisioning/datasources/ # Scrapped by Prometheus for docker container cadvisor: image: gcr.io/cadvisor/cadvisor ports: - 8080:8080 volumes: - /:/rootfs:ro - /var/run:/var/run:rw - /sys:/sys:ro - /var/lib/docker/:/var/lib/docker:ro # Scrapped by Prometheus for host machine node-exporter: image: prom/node-exporter restart: unless-stopped ports: - 9100:9100 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)($$|/)' # Scrapped by Prometheus for nginx routing nginx-exporter: image: nginx/nginx-prometheus-exporter restart: unless-stopped command: "-nginx.scrape-uri=http://nginx:8080/stub_status" ports: - 9114:9113 volumes: prometheus-data: external: false grafana-data: external: false