From 1fdf226802d67445f7570b34a3323463e165770d Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Tue, 18 May 2021 11:48:15 -0400 Subject: [PATCH] Use curl-based healthcheck w/ new non-auth route The wget method seemed to have a possible issue with creating endless index.html copies (despite being specified to output to console only), so this has been updated to use curl instead. Also uses new non-authenticated "healthz" route to perform the healthcheck. Fix #316 Fix #313 --- Dockerfile | 4 ++-- app/routes.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index df50793..e153f0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.8-slim RUN apt-get update && apt-get install -y \ libcurl4-openssl-dev \ tor \ - wget \ + curl \ && rm -rf /var/lib/apt/lists/* ARG config_dir=/config @@ -68,6 +68,6 @@ COPY whoogle.env . EXPOSE $EXPOSE_PORT HEALTHCHECK --interval=30s --timeout=5s \ - CMD wget -qO- --no-verbose --tries=1 http://localhost:${EXPOSE_PORT}/ || exit 1 + CMD curl -f http://localhost:${EXPOSE_PORT}/healthz || exit 1 CMD misc/tor/start-tor.sh & ./run diff --git a/app/routes.py b/app/routes.py index 7867442..44c5ed4 100644 --- a/app/routes.py +++ b/app/routes.py @@ -110,6 +110,11 @@ def unknown_page(e): return redirect(g.app_location) +@app.route('/healthz', methods=['GET']) +def healthz(): + return '' + + @app.route('/', methods=['GET']) @auth_required def index():