Update php version, fix permission issue

This commit is contained in:
2024-01-06 12:15:51 +01:00
parent 5badbd3c99
commit 800c42b038
18 changed files with 125 additions and 118 deletions

View File

@@ -1,16 +1,27 @@
#!/bin/sh
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
#!/bin/bash
echo ""
echo "***********************************************************"
echo " Starting LARAVEL PHP-FPM Container "
echo "***********************************************************"
set -e
info() {
{ set +x; } 2> /dev/null
echo '[INFO] ' "$@"
}
warning() {
{ set +x; } 2> /dev/null
echo '[WARNING] ' "$@"
}
fatal() {
{ set +x; } 2> /dev/null
echo '[ERROR] ' "$@" >&2
exit 1
}
## Check if the artisan file exists
if [ -f /var/www/html/artisan ]; then
echo "${Green} artisan file found, creating laravel supervisor config..."
info "Artisan file found, creating laravel supervisor config..."
##Create Laravel Scheduler process
TASK=/etc/supervisor/conf.d/laravel-worker.conf
touch $TASK
@@ -21,7 +32,7 @@ if [ -f /var/www/html/artisan ]; then
autostart=true
autorestart=true
numprocs=1
user=www-data
user=$USER_NAME
stdout_logfile=/var/log/laravel_scheduler.out.log
redirect_stderr=true
@@ -31,36 +42,32 @@ if [ -f /var/www/html/artisan ]; then
autostart=true
autorestart=true
numprocs=$LARAVEL_PROCS_NUMBER
user=www-data
user=$USER_NAME
redirect_stderr=true
stdout_logfile=/var/log/laravel_worker.log
EOF
echo "${Green} Laravel supervisor config created"
info "Laravel supervisor config created"
else
echo "${Red} artisan file not found"
info "artisan file not found"
fi
## Check if the supervisor config file exists
if [ -f /var/www/html/conf/worker/supervisor.conf ]; then
echo "additional supervisor config found"
info "additional supervisor config found"
cp /var/www/html/conf/worker/supervisor.conf /etc/supervisor/conf.d/supervisor.conf
else
echo "${Red} Supervisor.conf not found"
echo "${Green} If you want to add more supervisor configs, create config file in /var/www/html/conf/worker/supervisor.conf"
echo "${Green} Start supervisor with default config..."
info "Supervisor.conf not found"
info "If you want to add more supervisor configs, create config file in /var/www/html/conf/worker/supervisor.conf"
info "Start supervisor with default config..."
fi
## Check if php.ini file exists
if [ -f /var/www/html/conf/php/php.ini ]; then
cp /var/www/html/conf/php/php.ini $PHP_INI_DIR/conf.d/
echo "Custom php.ini file found and copied in $PHP_INI_DIR/conf.d/"
info "Custom php.ini file found and copied in $PHP_INI_DIR/conf.d/"
else
echo "Custom php.ini file not found"
echo "If you want to add a custom php.ini file, you add it in /var/www/html/conf/php/php.ini"
info "Custom php.ini file not found"
info "If you want to add a custom php.ini file, you add it in /var/www/html/conf/php/php.ini"
fi
echo ""
echo "**********************************"
echo " Starting Supervisord... "
echo "***********************************"
supervisord -c /etc/supervisor/supervisord.conf
exec "$@"