|
| 1 | +services: |
| 2 | + prometheus: |
| 3 | + image: prom/prometheus:v2.41.0 |
| 4 | + container_name: prometheus |
| 5 | + healthcheck: |
| 6 | + test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090" ] |
| 7 | + interval: 10s |
| 8 | + timeout: 15s |
| 9 | + retries: 10 |
| 10 | + ports: |
| 11 | + - "9090:9090" |
| 12 | + volumes: |
| 13 | + - ./prometheus/:/etc/prometheus/ |
| 14 | + - prometheus:/prometheus |
| 15 | + command: |
| 16 | + - "--config.file=/etc/prometheus/prometheus.yml" |
| 17 | + - "--storage.tsdb.path=/prometheus/data" |
| 18 | + |
| 19 | + node-exporter: |
| 20 | + image: prom/node-exporter:v1.6.1 |
| 21 | + container_name: node-exporter |
| 22 | + command: |
| 23 | + - --path.procfs=/host/proc |
| 24 | + - --path.sysfs=/host/sys |
| 25 | + - --path.rootfs=/host/root |
| 26 | + - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/) |
| 27 | + - --collector.netclass.ignored-devices=^(veth.*)$ |
| 28 | + volumes: |
| 29 | + - /proc:/host/proc:ro |
| 30 | + - /sys:/host/sys:ro |
| 31 | + - /:/rootfs:ro |
| 32 | + depends_on: |
| 33 | + prometheus: |
| 34 | + condition: service_healthy |
| 35 | + |
| 36 | + cadvisor: |
| 37 | + image: gcr.io/cadvisor/cadvisor:v0.49.1 |
| 38 | + container_name: cadvisor |
| 39 | + privileged: true |
| 40 | + ports: |
| 41 | + - "8880:8080" |
| 42 | + devices: |
| 43 | + - /dev/kmsg |
| 44 | + volumes: |
| 45 | + - /:/rootfs:ro |
| 46 | + - /sys:/sys:ro |
| 47 | + - /var/run:/var/run:rw |
| 48 | + - /dev/disk/:/dev/disk:ro |
| 49 | + - /var/lib/docker/:/var/lib/docker:ro |
| 50 | + - /var/run/docker.sock:/var/run/docker.sock:rw |
| 51 | + depends_on: |
| 52 | + prometheus: |
| 53 | + condition: service_healthy |
| 54 | + |
| 55 | + grafana: |
| 56 | + image: grafana/grafana:9.4.7 |
| 57 | + container_name: grafana |
| 58 | + environment: |
| 59 | + - GF_AUTH_ANONYMOUS_ENABLED=true |
| 60 | + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin |
| 61 | + - GF_AUTH_BASIC_ENABLED=false |
| 62 | + - GF_USERS_DEFAULT_THEME=light |
| 63 | + healthcheck: |
| 64 | + test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health" ] |
| 65 | + interval: 10s |
| 66 | + timeout: 15s |
| 67 | + retries: 10 |
| 68 | + ports: |
| 69 | + - "3000:3000" |
| 70 | + volumes: |
| 71 | + - grafana:/var/lib/grafana |
| 72 | + - ./grafana/:/etc/grafana/provisioning/ |
| 73 | + depends_on: |
| 74 | + prometheus: |
| 75 | + condition: service_healthy |
| 76 | + |
| 77 | +volumes: |
| 78 | + prometheus: |
| 79 | + grafana: |
0 commit comments