Skip to content

Commit

Permalink
Fix opensearch health check from php container
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreGauthier committed Sep 27, 2024
1 parent 30e2167 commit 877d405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/php/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then

if grep -q ELASTICSEARCH_URL= .env; then
echo "Waiting for search engine to be ready..."
ATTEMPTS_LEFT_TO_REACH_SEARCH=30
ATTEMPTS_LEFT_TO_REACH_SEARCH=100
until [ $ATTEMPTS_LEFT_TO_REACH_SEARCH -eq 0 ] || SEARCH_ERROR=$(curl -ks ${ELASTICSEARCH_URL}); do
sleep 2
ATTEMPTS_LEFT_TO_REACH_SEARCH=$((ATTEMPTS_LEFT_TO_REACH_SEARCH - 1))
echo "Still waiting for search engine to be ready... Or maybe the search engine is not reachable. $ATTEMPTS_LEFT_TO_REACH_SEARCH attempts left."
done

if [ $ATTEMPTS_LEFT_TO_REACH_SEARCH -eq 0 ]; then
echo "The search engine is not up or not reachable:"
echo "curl -s $ELASTICSEARCH_URL : $SEARCH_ERROR"
Expand Down

0 comments on commit 877d405

Please sign in to comment.