From 253eae0e158ea3c94d66b719824e78a20620fa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 15 Sep 2023 17:49:22 +0200 Subject: [PATCH] chore: sync with API Platform --- .gitattributes | 1 + docker-compose.override.yml | 2 +- docker/php/docker-entrypoint.sh | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index 590d686..642c91f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,7 @@ *.yaml text eol=lf *.yml text eol=lf bin/console text eol=lf +composer.lock text eol=lf merge=ours *.ico binary *.png binary diff --git a/docker-compose.override.yml b/docker-compose.override.yml index fc6ff5d..8a45c59 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -20,7 +20,7 @@ services: - host.docker.internal:host-gateway caddy: - command: [ "caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile", "--watch" ] + command: [ "caddy", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ] build: context: . target: caddy_base diff --git a/docker/php/docker-entrypoint.sh b/docker/php/docker-entrypoint.sh index 07c80b3..4cbfee6 100755 --- a/docker/php/docker-entrypoint.sh +++ b/docker/php/docker-entrypoint.sh @@ -32,9 +32,9 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then fi if grep -q ^DATABASE_URL= .env; then - echo "Waiting for db to be ready..." + echo "Waiting for database to be ready..." ATTEMPTS_LEFT_TO_REACH_DATABASE=60 - until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(bin/console dbal:run-sql "SELECT 1" 2>&1); do + until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(php bin/console dbal:run-sql -q "SELECT 1" 2>&1); do if [ $? -eq 255 ]; then # If the Doctrine command exits with 255, an unrecoverable error occurred ATTEMPTS_LEFT_TO_REACH_DATABASE=0 @@ -42,7 +42,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then fi sleep 1 ATTEMPTS_LEFT_TO_REACH_DATABASE=$((ATTEMPTS_LEFT_TO_REACH_DATABASE - 1)) - echo "Still waiting for db to be ready... Or maybe the db is not reachable. $ATTEMPTS_LEFT_TO_REACH_DATABASE attempts left" + echo "Still waiting for database to be ready... Or maybe the database is not reachable. $ATTEMPTS_LEFT_TO_REACH_DATABASE attempts left." done if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then @@ -50,11 +50,11 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then echo "$DATABASE_ERROR" exit 1 else - echo "The db is now ready and reachable" + echo "The database is now ready and reachable" fi if [ "$( find ./migrations -iname '*.php' -print -quit )" ]; then - bin/console doctrine:migrations:migrate --no-interaction + php bin/console doctrine:migrations:migrate --no-interaction fi fi