From e2fd3369f68c34ada870083a0eb3d6855eafcc67 Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Mon, 19 Aug 2024 12:44:00 +0200 Subject: [PATCH] Addition of health check, based on subscriptions until next release. --- docker/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index da2b63a..370c6b6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,3 @@ -#checkov:skip=CKV_DOCKER_2:No healthcheck, dockerfile only used in testing -#checkov:skip=CKV_DOCKER_3 FROM python:3.12-slim-bookworm SHELL ["/bin/bash", "-c"] @@ -61,5 +59,10 @@ USER wis2downloader WORKDIR /home/wis2downloader RUN crontab ./app/clean_downloads.cron ENTRYPOINT [ "/home/wis2downloader/app/entrypoint.sh" ] + +# Add healthcheck +HEALTHCHECK --interval=1m --timeout=3s \ + CMD curl -f http://localhost:5000/subscriptions || exit 1 + # Run wis2downloader when the container launches CMD ["/bin/bash", "-c", "source .venv/bin/activate && gunicorn --bind 0.0.0.0:5000 --workers 1 wis2downloader.app:app"] \ No newline at end of file