Skip to content

Commit

Permalink
Add a default health check
Browse files Browse the repository at this point in the history
With a check as part of the image, users don't have to configure the
checks themselves in a Compose file, for example.
  • Loading branch information
IngmarStein committed Sep 16, 2024
1 parent 39616ea commit ad43719
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,6 @@ RUN [ "drill", "-v" ]
# hadolint ignore=DL3059
RUN [ "dig", "-v" ]

HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD ["drill", "@127.0.0.1", "cloudflare.com"]

ENTRYPOINT [ "unbound" ]
2 changes: 1 addition & 1 deletion examples/pi-hole/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
default:
ipv4_address: 172.28.0.2
healthcheck:
test: ["CMD", "dig", "-p", "53", "dnssec.works", "@127.0.0.1"]
test: ["CMD", "drill", "@127.0.0.1", "dnssec.works"]
interval: 30s
timeout: 30s
retries: 3
Expand Down

0 comments on commit ad43719

Please sign in to comment.