[GH-ISSUE #184] [FEATURE] add healthcheck or curl to docker container #131

Closed
opened 2026-02-25 20:34:58 +03:00 by kerem · 3 comments
Owner

Originally created by @somebody-somewhere-over-the-rainbow on GitHub (Jan 27, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/184

would like to make use of docker healthchecks in order to restart the container in case it crashes. It would be great if either a healthcheck is directly integrated into the container or curl is installed into the container so that people can setup their own healthcheck. Right now I am building an image ontop of the original one to run apt update && apt install curl as a workaround.
FYI: I am using https://hub.docker.com/r/willfarrell/autoheal/ to make the restart happen.

Originally created by @somebody-somewhere-over-the-rainbow on GitHub (Jan 27, 2021). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/184 would like to make use of docker healthchecks in order to restart the container in case it crashes. It would be great if either a healthcheck is directly integrated into the container or curl is installed into the container so that people can setup their own healthcheck. Right now I am building an [image](https://hub.docker.com/repository/docker/alexw1982/whoogle) ontop of the original one to run `apt update && apt install curl` as a workaround. FYI: I am using `https://hub.docker.com/r/willfarrell/autoheal/` to make the restart happen.
kerem 2026-02-25 20:34:58 +03:00
Author
Owner

@somebody-somewhere-over-the-rainbow commented on GitHub (Feb 9, 2021):

Please ignore the curl part of the request as there are other tools (wget) already included in the container that allow for basic health checks ...

<!-- gh-comment-id:776158017 --> @somebody-somewhere-over-the-rainbow commented on GitHub (Feb 9, 2021): Please ignore the curl part of the request as there are other tools (wget) already included in the container that allow for basic health checks ...
Author
Owner

@pred2k commented on GitHub (Feb 24, 2021):

I think this would do it.

diff --git a/Dockerfile b/Dockerfile
index a62bcee..66cf054 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,8 @@ RUN apt-get update && apt-get install -y \
     libxml2-dev \
     libxslt-dev \
     libffi-dev \
-    tor
+    tor \
+    curl

 COPY config/tor/torrc /etc/tor/torrc
 COPY requirements.txt .
@@ -52,4 +53,7 @@ COPY . .

 EXPOSE $EXPOSE_PORT

+HEALTHCHECK --interval=3m --timeout=5s \
+  CMD curl --fail http://localhost:${EXPOSE_PORT}/ || exit 1
+
 CMD config/tor/start-tor.sh & ./run
<!-- gh-comment-id:785199762 --> @pred2k commented on GitHub (Feb 24, 2021): I think this would do it. ```diff diff --git a/Dockerfile b/Dockerfile index a62bcee..66cf054 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ RUN apt-get update && apt-get install -y \ libxml2-dev \ libxslt-dev \ libffi-dev \ - tor + tor \ + curl COPY config/tor/torrc /etc/tor/torrc COPY requirements.txt . @@ -52,4 +53,7 @@ COPY . . EXPOSE $EXPOSE_PORT +HEALTHCHECK --interval=3m --timeout=5s \ + CMD curl --fail http://localhost:${EXPOSE_PORT}/ || exit 1 + CMD config/tor/start-tor.sh & ./run ```
Author
Owner

@benbusby commented on GitHub (Mar 8, 2021):

Apologies for the delay on this! I've added a (wget) healthcheck now, which should be available shortly for all develop images.

<!-- gh-comment-id:792941540 --> @benbusby commented on GitHub (Mar 8, 2021): Apologies for the delay on this! I've added a (wget) healthcheck now, which should be available shortly for all `develop` images.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#131
No description provided.