From 62f0bf04eeea9e6fb54f883833dcfbf070326b5e Mon Sep 17 00:00:00 2001 From: Chris Plaatjes Date: Wed, 26 Jan 2022 13:51:03 -0500 Subject: [PATCH] Docker Healthcheck (#994) * Implemented healthchecks into the docker files * Added healthcheck entry in Dockerfile --- Dockerfile | 4 +++- docker-compose.yml | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 82fd49132..faff119ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ COPY --from=copytask /files/wwwroot /kavita/wwwroot #Installs program dependencies RUN apt-get update \ - && apt-get install -y libicu-dev libssl1.1 libgdiplus \ + && apt-get install -y libicu-dev libssl1.1 libgdiplus curl\ && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /entrypoint.sh @@ -29,5 +29,7 @@ EXPOSE 5000 WORKDIR /kavita +HEALTHCHECK --interval=300s --timeout=15 --start-period=30s --retries=3 CMD curl --fail http://localhost:5000 || exit 1 + ENTRYPOINT [ "/bin/bash" ] CMD ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index fd6d9b8a6..e75c9b0c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,3 +9,11 @@ services: ports: - "5000:5000" restart: unless-stopped + + #Uncomment if you want to implement healthchecks + #healthcheck: + # test: curl --fail http://localhost:5000 || exit 1 + # interval: 300s + # retries: 3 + # start_period: 30s + # timeout: 15s