diff --git a/.docker/php/docker-entrypoint.sh b/.docker/php/docker-entrypoint.sh index 61987f56..91287269 100644 --- a/.docker/php/docker-entrypoint.sh +++ b/.docker/php/docker-entrypoint.sh @@ -16,10 +16,6 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then composer install --prefer-dist --no-progress --no-interaction || true fi - if [ "$APP_ENV" = 'prod' ]; then - php bin/console doctrine:migrations:migrate --allow-no-migration --no-interaction - fi - if grep -q DATABASE_URL= .env; then echo "Waiting for database to be ready..." ATTEMPTS_LEFT_TO_REACH_DATABASE=60 @@ -47,6 +43,10 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then fi fi + if [ "$APP_ENV" = 'prod' ]; then + php bin/console doctrine:migrations:migrate --allow-no-migration --no-interaction + fi + fi exec docker-php-entrypoint "$@"