diff --git a/prometheus.yaml b/prometheus.yaml index c0c95ee..6ce8dce 100644 --- a/prometheus.yaml +++ b/prometheus.yaml @@ -2,13 +2,18 @@ version: '3' services: prometheus: image: prom/prometheus + restart: always container_name: prometheus + user: root volumes: - - ./data/prometheus/storage:/prometheus + - ./data/prometheus/storage:/prometheus:rw - ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml:ro + - ./prometheus/entrypoint.sh:/entrypoint.sh:ro + entrypoint: ["/entrypoint.sh"] cadvisor: image: gcr.io/cadvisor/cadvisor:latest + restart: always container_name: cadvisor volumes: - /:/rootfs:ro diff --git a/prometheus/entrypoint.sh b/prometheus/entrypoint.sh new file mode 100755 index 0000000..fe60e34 --- /dev/null +++ b/prometheus/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh -x + +chmod 777 /prometheus +exec su -s /bin/sh nobody <