Skip to content

Commit

Permalink
Addition of health check, based on subscriptions until next release.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Aug 19, 2024
1 parent 59e26b5 commit e2fd336
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -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"]

0 comments on commit e2fd336

Please sign in to comment.