From d3b758d10ab8b4b211dedd21534e1a12c13a62a7 Mon Sep 17 00:00:00 2001 From: Klarstein <62219057+Klarstein@users.noreply.github.com> Date: Wed, 27 Jan 2021 07:16:59 +0100 Subject: [PATCH] Add docker healthcheck (#1492) --- docker/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 899a1654c6..12b06ec284 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,6 +15,10 @@ ENV USERNAME="" PASSWORD="" # Expose the dashboard to Docker EXPOSE 6052 +# Run healthcheck (heartbeat) +HEALTHCHECK --interval=5m --timeout=3s \ + CMD curl --fail http://localhost:6052 || exit 1 + # The directory the user should mount their configuration files to WORKDIR /config # Set entrypoint to esphome so that the user doesn't have to type 'esphome'