From e5d1f6a2927a9e8d6754356747646cac929ea06b Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Mon, 8 Mar 2021 12:38:40 -0500 Subject: [PATCH] Add healthcheck to Dockerfile See #184 --- Dockerfile | 3 +++ app/utils/results.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d901769..981512b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,4 +62,7 @@ COPY run . EXPOSE $EXPOSE_PORT +HEALTHCHECK --interval=5m --timeout=5s \ + CMD wget --no-verbose --tries=1 http://localhost:${EXPOSE_PORT}/ || exit 1 + CMD config/tor/start-tor.sh & ./run diff --git a/app/utils/results.py b/app/utils/results.py index a1d20dc..58c450f 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -38,8 +38,8 @@ def has_ad_content(element: str) -> bool: bool: True/False for the element containing an ad """ - return element.upper() in (value.upper() for value in BLACKLIST) \ - or 'ⓘ' in element + return (element.upper() in (value.upper() for value in BLACKLIST) + or 'ⓘ' in element) def get_first_link(soup: BeautifulSoup) -> str: