Skip to content

Commit

Permalink
Fix for incorrect empty string check on $PHP_EXTENSIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kionga-Kamau committed Sep 10, 2024
1 parent a666921 commit 46ca7fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/php-apache/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ services:
- ${PHP_WEB_ROOT:-./app}:/var/www/html
command: >
/bin/bash -c "
if [ -n $${PHP_EXTENSIONS+x} ]; then
if [ -n $${#PHP_EXTENSIONS} -gt 0 ]; then
docker-php-ext-install $$PHP_EXTENSIONS || {
echo 'Error installing PHP extensions via docker-php-ext-install - check your docker-compose.yml command: section';
echo 'Error installing PHP extensions via docker-php-ext-install $$PHP_EXTENSIONS ($PHP_EXTENSIONS) - check your docker-compose.yml command: section';
exit 1;
}
fi &&
if ! grep -q 'ServerName' /etc/apache2/apache2.conf; then
echo 'ServerName $$APACHE_SERVER_NAME' >> /etc/apache2/apache2.conf;
else
sed -i 's/^ServerName .*/ServerName $$APACHE_SERVER_NAME/' /etc/apache2/apache2.conf;
fi;
fi &&
apache2-foreground"

0 comments on commit 46ca7fa

Please sign in to comment.