From cb2c02c31a51f23998406d3c9847e1f889d4cc18 Mon Sep 17 00:00:00 2001 From: Vladimir Remenar Date: Sat, 16 Mar 2024 19:48:02 +0100 Subject: [PATCH] Simplify docker-compose --- docker-compose.yml | 36 ++++++++++++++++++------------------ pihole-exporter.env | 4 ++++ 2 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 pihole-exporter.env diff --git a/docker-compose.yml b/docker-compose.yml index 3996326..ecd3a1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,19 @@ -version: "3.6" services: - pihole_exporter: - build: - context: ./ - args: - ARCH: CHANGE_ME - dockerfile: Dockerfile - image: ekofr/pihole-exporter:arm64 - container_name: pihole_exporter - expose: - - 9617 - environment: - PIHOLE_HOSTNAME: CHANGE_ME - PIHOLE_PORT: CHANGE_ME - PIHOLE_PASSWORD: CHANGE_ME - INTERVAL: 30s - PORT: 9617 - restart: always + pihole-exporter: + container_name: pihole-exporter + image: ekofr/pihole-exporter:latest + env_file: + - pihole-exporter.env + ports: + - "9617:9617" + logging: + driver: "json-file" + options: + max-size: "5k" + max-file: "5" + healthcheck: + test: ["CMD", "wget", "--tries=1", "--spider", "http://localhost:9617/metrics"] + interval: 300s + retries: 5 + timeout: 10s + restart: always \ No newline at end of file diff --git a/pihole-exporter.env b/pihole-exporter.env new file mode 100644 index 0000000..7fba11d --- /dev/null +++ b/pihole-exporter.env @@ -0,0 +1,4 @@ +PIHOLE_HOSTNAME=pihole # Chage to PiHole's IP address or FQDN +PIHOLE_PASSWORD=MyStrongPassword # Change to your PiHole's password +INTERVAL=90s +PORT=9617 \ No newline at end of file