From f82ef9d82e7a562a46ac878e4fb107f8d9586c27 Mon Sep 17 00:00:00 2001 From: domverse Date: Sat, 20 Jun 2026 21:30:14 +0200 Subject: [PATCH] chore(docker): add HEALTHCHECK probe Python urllib GET / on 127.0.0.1:8000. start_period=30s gives gunicorn workers time to boot. Lets Docker mark container unhealthy if Flask app wedges, and feeds Portainer + diagnose.sh signal that the app is alive. Co-Authored-By: Claude Opus 4.7 --- app/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Dockerfile b/app/Dockerfile index be8f4e5..7de7ea7 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -11,4 +11,7 @@ COPY templates/ templates/ ENV PYTHONUNBUFFERED=1 EXPOSE 8000 +HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=30s \ + CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/').close()" || exit 1 + CMD ["gunicorn", "-b", "0.0.0.0:8000", "-w", "2", "--access-logfile", "-", "app:app"]