diff --git a/config/entrypoint.sh b/config/entrypoint.sh index a1e4804..d9b7385 100755 --- a/config/entrypoint.sh +++ b/config/entrypoint.sh @@ -17,6 +17,7 @@ fi # run framework setups if [ -d /scripts/frameworks ]; then + cd /application echo "[-] Calling framework setup scripts..." for filename in /scripts/frameworks/*.sh; do sh "$filename" && break diff --git a/config/frameworks/10-symfony.sh b/config/frameworks/10-symfony.sh index 0e0a572..6cb5986 100644 --- a/config/frameworks/10-symfony.sh +++ b/config/frameworks/10-symfony.sh @@ -4,8 +4,18 @@ if [ ! -f /application/symfony.lock ]; then exit 1 fi -echo " == Detected Symfony project" -cd /application +if [ -d /application/config/bolt ]; then + echo " == Detected Symfony (Bolt) project" + VARIANT=bolt +else + echo " == Detected Symfony project" + VARIANT=vanilla +fi + +if [ -f /application/.symfony-preinit ]; then + echo " -> Running container-provided .symfony-preinit script" + sh /application/.symfony-preinit +fi echo " -> Installing dependencies using composer..." /usr/bin/composer install --no-dev --no-cache --optimize-autoloader --no-progress -q || exit 0 @@ -16,7 +26,7 @@ if [ -f /application/.symfony-init ]; then fi echo " -> Testing environment..." -if bin/console &>/dev/null; then +if bin/console about -q; then echo " ++ Successful" else echo " !! Failed" diff --git a/config/frameworks/90-composer.sh b/config/frameworks/90-composer.sh index 3c25379..ecfab1c 100644 --- a/config/frameworks/90-composer.sh +++ b/config/frameworks/90-composer.sh @@ -5,7 +5,6 @@ if [ ! -f /application/composer.json ]; then fi echo " == Detected composer project." -cd /application echo " -> Installing dependencies using composer..." /usr/bin/composer install --no-dev --no-cache --optimize-autoloader --no-progress -q || exit 0 diff --git a/templates/symfony.Dockerfile b/templates/symfony.Dockerfile index fbb3050..90acee5 100644 --- a/templates/symfony.Dockerfile +++ b/templates/symfony.Dockerfile @@ -1,9 +1,11 @@ +# # Dockerfile template for Symfony based projects using PHP 8.3 # # Magic files (in /application): # -# .nginx-site Override nginx site default.conf -# .symfony-init Initializes Symfony framework install +# .nginx-site Override nginx site default.conf +# .symfony-preinit Called before composer install +# .symfony-init Called after compose install # FROM dev.noccylabs.info/noccylabs/alpine-php83-aio:latest