diff --git a/container/webui/docker-compose.yaml b/container/webui/docker-compose.yaml index 1c29cc4b89d..b7e50a13028 100644 --- a/container/webui/docker-compose.yaml +++ b/container/webui/docker-compose.yaml @@ -135,7 +135,12 @@ services: volumes: - ./workdir/db:/var/lib/postgresql/data:Z healthcheck: - test: ["CMD", "sh", "-c", "echo 'select * from api_keys;' | psql -U openqa -v 'ON_ERROR_STOP=1' openqa"] + test: + - CMD-SHELL + - >- + pg_isready -U openqa -d openqa + && echo 'select * from api_keys;' + | psql -U openqa -v 'ON_ERROR_STOP=1' openqa interval: 10s timeout: 10s retries: 3 diff --git a/container/webui/run_openqa.sh b/container/webui/run_openqa.sh index 51d4630ea50..7ef81806d9f 100644 --- a/container/webui/run_openqa.sh +++ b/container/webui/run_openqa.sh @@ -2,6 +2,7 @@ set -e function wait_for_db_creation() { + return echo "Waiting for DB creation" while ! su geekotest -c 'PGPASSWORD=openqa psql -h db -U openqa --list | grep -qe openqa'; do sleep .1; done }