File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,17 +48,22 @@ jobs:
4848 max_wait=300
4949 current_wait=0
5050 while [ $current_wait -lt $max_wait ]; do
51- if [ "$(docker compose ps -q web | xargs docker inspect -f '{{.State.Health.Status}}')" = "healthy" ] &&
52- [ "$(docker compose ps -q firebird | xargs docker inspect -f '{{.State.Health.Status}}')" = "healthy" ]; then
51+ web_status=$(docker compose ps --format json web | jq -r '.[0].Health' 2>/dev/null || docker inspect -f '{{.State.Health.Status}}' $(docker compose ps -q web))
52+ firebird_status=$(docker compose ps --format json firebird | jq -r '.[0].Health' 2>/dev/null || docker inspect -f '{{.State.Health.Status}}' $(docker compose ps -q firebird))
53+
54+ if [ "$web_status" = "healthy" ] && [ "$firebird_status" = "healthy" ]; then
5355 echo "Services are healthy!"
54- docker compose logs
5556 exit 0
5657 fi
57- echo -n ". "
58- sleep 5
59- current_wait=$((current_wait + 5 ))
58+ echo "Waiting... Web: $web_status, Firebird: $firebird_status "
59+ sleep 10
60+ current_wait=$((current_wait + 10 ))
6061 done
6162 echo "Services did not become healthy in time."
63+ echo "--- Firebird Healthcheck Logs ---"
64+ docker inspect --format='{{json .State.Health}}' $(docker compose ps -q firebird)
65+ echo "--- Web Healthcheck Logs ---"
66+ docker inspect --format='{{json .State.Health}}' $(docker compose ps -q web)
6267 docker compose logs
6368 exit 1
6469
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
77 FIREBIRD_ROOT_PASSWORD : test
88 FIREBIRD_DATABASE : test.fdb
99 healthcheck :
10- test : ["CMD-SHELL", "isql -user sysdba -password test localhost :/var/lib/firebird/data/test.fdb -q -e 'quit;'"]
10+ test : ["CMD-SHELL", "/opt/firebird/bin/ isql -user sysdba -password test 127.0.0.1 :/var/lib/firebird/data/test.fdb -q -e 'quit;'"]
1111 interval : 10s
1212 timeout : 10s
1313 retries : 30
You can’t perform that action at this time.
0 commit comments