From 525b22864a3c2c585a44b06ad51f2523f4f1ba64 Mon Sep 17 00:00:00 2001 From: Sam Berry Date: Thu, 12 Mar 2026 13:41:43 +0000 Subject: [PATCH 1/2] Use ruby instead of curl to check web service health. The slim docker images do not contain curl causing the healthcheck to fail and the container to be restarted by autoheal. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5d7c9a5..560930c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,7 +84,7 @@ services: labels: - autoheal=true healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}/health_checks/default"] + test: ["CMD", "ruby", "-e", "require 'net/http'; exit 1 unless Net::HTTP.get_response(URI('http://localhost:8080/health_checks/default')).is_a?(Net::HTTPSuccess)"] interval: 10s timeout: 3s retries: 3 From b5958261c92b5f2e80c46114a4603141e2bb15ae Mon Sep 17 00:00:00 2001 From: Sam Berry Date: Thu, 12 Mar 2026 15:07:09 +0000 Subject: [PATCH 2/2] Included relative URL support in healthcheck The OPENPROJECT_RAILS__RELATIVE__URL__ROOT environment variable was added to the healthcheck command to support relative URLs. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 560930c..8499282 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,7 +84,7 @@ services: labels: - autoheal=true healthcheck: - test: ["CMD", "ruby", "-e", "require 'net/http'; exit 1 unless Net::HTTP.get_response(URI('http://localhost:8080/health_checks/default')).is_a?(Net::HTTPSuccess)"] + test: ["CMD", "ruby", "-e", "require 'net/http'; exit 1 unless Net::HTTP.get_response(URI('http://localhost:8080${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}/health_checks/default')).is_a?(Net::HTTPSuccess)"] interval: 10s timeout: 3s retries: 3