From e264213392e8e64c3a781ede1a367f6c6f5c8b19 Mon Sep 17 00:00:00 2001 From: mifi Date: Thu, 24 Jul 2025 10:39:29 -0300 Subject: [PATCH] Resolve healthcheck issues around domain splitting with an index route --- app.py | 4 ++++ docker-compose.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 99ca668..72abba2 100644 --- a/app.py +++ b/app.py @@ -7,6 +7,10 @@ env = jinja2.Environment( autoescape=jinja2.select_autoescape(['xml']) ) +@app.route('/') +def index(): + return "Mail Autoconfig Service is running." + @app.route('/mail/config-v1.1.xml') def thunderbird_config(): domain = request.host.split('.', 1)[1] diff --git a/docker-compose.yml b/docker-compose.yml index f438dd1..a611932 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: container_name: mail-autoconfig restart: unless-stopped healthcheck: - test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:80/mail/config-v1.1.xml')"] + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:80/')"] interval: 30s timeout: 10s retries: 3