Add COMPOSER_EXTRA_PACKAGES environment variable support for Docker containers

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-12-07 13:23:49 +00:00
parent 18aa531c75
commit 43996160c0
3 changed files with 64 additions and 1 deletions

View file

@ -39,6 +39,18 @@ if [ -d /var/www/html/var/db ]; then
fi
fi
# Install additional composer packages if COMPOSER_EXTRA_PACKAGES is set
if [ -n "$COMPOSER_EXTRA_PACKAGES" ]; then
echo "Installing additional composer packages: $COMPOSER_EXTRA_PACKAGES"
sudo -E -u www-data composer require $COMPOSER_EXTRA_PACKAGES --no-interaction --no-progress --optimize-autoloader
if [ $? -eq 0 ]; then
echo "Successfully installed additional composer packages"
else
echo "Failed to install additional composer packages"
exit 1
fi
fi
# Start PHP-FPM (the PHP_VERSION is replaced by the configured version in the Dockerfile)
php-fpmPHP_VERSION -F &