fix: install curl, healthcheck accepts 200 or 403

This commit is contained in:
Alejandro Martinez
2026-04-12 04:12:43 +02:00
parent aa82f768e4
commit bbf783662a

View File

@@ -1,7 +1,6 @@
FROM mitmproxy/mitmproxy:latest
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
EXPOSE 8888 8081
HEALTHCHECK --interval=10s --timeout=5s --retries=10 --start-period=15s \
CMD python3 -c "import urllib.request,urllib.error; \
try: urllib.request.urlopen('http://localhost:8081'); \
except urllib.error.HTTPError: pass"
HEALTHCHECK --interval=10s --timeout=5s --retries=10 --start-period=30s \
CMD curl -sf -o /dev/null -w "%{http_code}" http://localhost:8081/ | grep -qE "200|403" || exit 1
ENTRYPOINT ["mitmweb", "--web-host", "0.0.0.0", "--web-port", "8081", "-p", "8888", "--ssl-insecure", "--set", "web_open_browser=false", "--set", "web_password=mitm"]