From aa82f768e41a464a5d58c51df622a5939fe0beef Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Sun, 12 Apr 2026 03:50:27 +0200 Subject: [PATCH] fix: healthcheck accepts 403 as healthy --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 81c1031..2ca4427 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM mitmproxy/mitmproxy:latest -RUN pip install --no-cache-dir httpie 2>/dev/null; apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* || true EXPOSE 8888 8081 HEALTHCHECK --interval=10s --timeout=5s --retries=10 --start-period=15s \ - CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8081')" || exit 1 + CMD python3 -c "import urllib.request,urllib.error; \ +try: urllib.request.urlopen('http://localhost:8081'); \ +except urllib.error.HTTPError: pass" ENTRYPOINT ["mitmweb", "--web-host", "0.0.0.0", "--web-port", "8081", "-p", "8888", "--ssl-insecure", "--set", "web_open_browser=false", "--set", "web_password=mitm"]