diff --git a/Dockerfile b/Dockerfile index c15ed1b..17f063b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM php:8.1-fpm ENV WORKDIR=/var/www ENV STORAGE_DIR=/var/www/storage +ENV LARAVEL_PROCS_NUMBER=2 # Install system dependencies RUN apt-get update && apt-get install -y \ git \ @@ -42,6 +43,7 @@ RUN docker-php-ext-enable rdkafka \ RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install zip mbstring exif pcntl bcmath -j$(nproc) gd intl + # Install Redis and enable it RUN pecl install redis && docker-php-ext-enable redis diff --git a/entrypoint.sh b/entrypoint.sh index 4b3e8e0..3abd28b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -53,7 +53,7 @@ if [ -f $WORKDIR/artisan ]; then command=php $WORKDIR/artisan queue:work --sleep=3 --tries=3 autostart=true autorestart=true - numprocs=2 + numprocs=$LARAVEL_PROCS_NUMBER user=root redirect_stderr=true stdout_logfile=/var/log/laravel_worker.log @@ -68,15 +68,19 @@ echo "Checking if storage directory exists" echo "Directory $STORAGE_DIR exist. Fixing permissions..." chown -R www-data:www-data $STORAGE_DIR chmod -R 775 $STORAGE_DIR - echo "${Green} Permissions fixed" + echo "${Green}Permissions fixed" else echo "${Red} Directory $STORAGE_DIR does not exist" echo "Fixing permissions from $WORKDIR" chown -R www-data:www-data $WORKDIR/storage chmod -R 775 $WORKDIR/storage - echo "${Green} Permissions fixed" + echo "${Green}Permissions fixed" fi +echo "" +echo "**********************************" +echo " Starting Supervisord... " +echo "***********************************" supervisord -c /etc/supervisor/supervisord.conf