Fix: Replace unsupported /dev/tcp healthcheck with onboard PHP socket check for websocket service

Replaced the previous shell-based /dev/tcp healthcheck with a PHP fsockopen() test to ensure compatibility with minimal base images. This avoids dependency on missing tools like nc or curl and provides a reliable onboard check.

Conversation: https://chatgpt.com/share/68deb8ec-d920-800f-bd35-2869544fe30f
This commit is contained in:
2025-10-02 19:40:13 +02:00
parent 9439ac7f76
commit 9d6cf03f5b

View File

@@ -65,7 +65,7 @@
{{ ESPOCRM_SERVICE }}:
condition: service_healthy
healthcheck:
test: ["CMD", "sh", "-c", "exec 3<>/dev/tcp/127.0.0.1/8080 && echo 'OK' && exec 3<&- 3>&-"]
test: ["CMD", "php", "-r", "($s=@fsockopen('127.0.0.1',8080,$e,$E,2))?fclose($s):exit(1);"]
interval: 30s
timeout: 5s
retries: 5