Updated alpine-setup.sh

This commit is contained in:
Muhamad Aditya Prima 2024-12-27 14:55:56 +07:00
parent 3db317a682
commit edcb233a46
2 changed files with 24 additions and 32 deletions

View File

@ -6,7 +6,7 @@ dom,embed,enchant,exif,ftp,
gd,gettext,gmp,iconv,imap, gd,gettext,gmp,iconv,imap,
intl,json,ldap,mcrypt, intl,json,ldap,mcrypt,
opcache,openssl,pcntl,pdo, opcache,openssl,pcntl,pdo,
pear,phar,phpdbg, pear,phpdbg,
posix,pspell,shmop, posix,pspell,shmop,
snmp,soap,sockets,sysvmsg,sysvsem, snmp,soap,sockets,sysvmsg,sysvsem,
sysvshm,wddx,xml,xmlreader, sysvshm,wddx,xml,xmlreader,
@ -19,24 +19,16 @@ LOG_LEVEL="info"
# Setup php flavor # Setup php flavor
if [[ "$FLAVOR" == "debug" ]]; then for i in $(echo $PHP_LIST | tr "," "\n"); do
LOG_LEVEL="debug"
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-dbg;
fi
if [ "$FLAVOR" == "full" ] || [ "$FLAVOR" == "debug" ]; then
for i in $(echo $PHP_LIST | tr "," "\n"); do
PHP_DEPS="${PHP_DEPS} php$PHP_VER_SHORT-$i "; PHP_DEPS="${PHP_DEPS} php$PHP_VER_SHORT-$i ";
done done
/sbin/apk add --update --no-cache $PHP_DEPS; /sbin/apk add --update --no-cache $PHP_DEPS;
fi
# Only setup apache with full flavor parameters # Only setup apache with full flavor parameters
if [ "$WITH_APACHE" == "true" ]; then if [ "$WITH_APACHE" == "true" ]; then
if [ "$FLAVOR" == "full" ] || [ "$FLAVOR" == "debug" ]; then /usr/sbin/addgroup -g 10001 apache ;
/usr/sbin/addgroup -g 10002 apache ; /usr/sbin/adduser -D -u 10001 -G apache -s /sbin/nologin -h $APP_ROOT apache ;
/usr/sbin/adduser -D -u 10002 -G apache -s /sbin/nologin -h $APP_ROOT apache ;
/sbin/apk add --update --no-cache apache2 php$PHP_VER_SHORT-apache2 ; /sbin/apk add --update --no-cache apache2 php$PHP_VER_SHORT-apache2 ;
sed -i "s|ServerRoot /var/www|ServerRoot ${SERVER_ROOT}|" /etc/apache2/httpd.conf ; sed -i "s|ServerRoot /var/www|ServerRoot ${SERVER_ROOT}|" /etc/apache2/httpd.conf ;
@ -54,7 +46,6 @@ if [ "$WITH_APACHE" == "true" ]; then
sed -i "s|Require host .example.com|#Require host .example.com|" /etc/apache2/conf.d/info.conf ; sed -i "s|Require host .example.com|#Require host .example.com|" /etc/apache2/conf.d/info.conf ;
sed -i "s|Require ip 127|Require all granted|" /etc/apache2/conf.d/info.conf ; sed -i "s|Require ip 127|Require all granted|" /etc/apache2/conf.d/info.conf ;
sed -i "s|/run/apache2/httpd.pid|${SERVER_ROOT}/run/httpd.pid|" /etc/apache2/conf.d/mpm.conf ; sed -i "s|/run/apache2/httpd.pid|${SERVER_ROOT}/run/httpd.pid|" /etc/apache2/conf.d/mpm.conf ;
fi
fi fi
if [ "$WITH_DATABASE" == "postgresql" ]; then if [ "$WITH_DATABASE" == "postgresql" ]; then
@ -62,5 +53,6 @@ if [ "$WITH_DATABASE" == "postgresql" ]; then
fi fi
if [ "$WITH_DATABASE" == "mysql" ]; then if [ "$WITH_DATABASE" == "mysql" ]; then
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-pdo php$PHP_VER_SHORT-pdo_mysql php$PHP_VER_SHORT-mysql php$PHP_VER_SHORT-mysqli ; /sbin/apk add --update --no-cache php$PHP_VER_SHORT-pdo php$PHP_VER_SHORT-pdo_mysql php$PHP_VER_SHORT-mysql \
php$PHP_VER_SHORT-mysqli ;
fi fi