From 8feff04136d56dc1586da33e7b9a4208422fdd59 Mon Sep 17 00:00:00 2001 From: jack Date: Fri, 27 Mar 2026 10:09:14 +0700 Subject: [PATCH] fix: use curl for Docmost health check, check Docker health status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - wget not available in Docmost Node.js image → switch to curl - Ansible now checks Docker health status instead of exec-ing into container - Increased healthcheck start_period to 60s and retries to 10 for DB migrations Co-Authored-By: Claude Sonnet 4.6 --- roles/services/tasks/main.yml | 7 ++++--- roles/services/templates/docker-compose.yml.j2 | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/roles/services/tasks/main.yml b/roles/services/tasks/main.yml index 49df3e0..38b3b1d 100644 --- a/roles/services/tasks/main.yml +++ b/roles/services/tasks/main.yml @@ -141,10 +141,11 @@ label: "{{ item.item }}" # ── Docmost: wait for healthy ──────────────────────────────────────────────── -- name: Wait for Docmost to be healthy - ansible.builtin.command: docker exec docmost wget -qO- http://127.0.0.1:3000/api/health +- name: Wait for Docmost container to be healthy + ansible.builtin.command: > + docker inspect --format='{{ '{{' }}.State.Health.Status{{ '}}' }}' docmost register: docmost_health changed_when: false retries: 30 delay: 10 - until: docmost_health.rc == 0 + until: docmost_health.stdout == 'healthy' diff --git a/roles/services/templates/docker-compose.yml.j2 b/roles/services/templates/docker-compose.yml.j2 index 5580ee0..1853101 100644 --- a/roles/services/templates/docker-compose.yml.j2 +++ b/roles/services/templates/docker-compose.yml.j2 @@ -513,11 +513,11 @@ services: docmost-redis: condition: service_healthy healthcheck: - test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/api/health"] + test: ["CMD", "curl", "-sf", "http://127.0.0.1:3000/api/health"] interval: 30s - timeout: 5s - retries: 5 - start_period: 30s + timeout: 10s + retries: 10 + start_period: 60s logging: driver: json-file options: