fix: properly check for DB environment (#107)

Make sure the `DATABASE_URL` is checked without comments :)
This commit is contained in:
Emanuele Panzeri 2021-01-14 22:02:29 +01:00 committed by GitHub
parent 80dc4fbed5
commit 3445aac4c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
composer install --prefer-dist --no-progress --no-interaction
fi
if grep -q DATABASE_URL= .env; then
if grep -q ^DATABASE_URL= .env; then
echo "Waiting for db to be ready..."
ATTEMPTS_LEFT_TO_REACH_DATABASE=60
until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || bin/console doctrine:query:sql "SELECT 1" >/dev/null 2>&1; do