From 1738e19dcf8490b413371d3538e8857cf92746d3 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Tue, 21 Jun 2022 10:43:47 +0200 Subject: [PATCH 1/4] Fix Dockefile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5a8d2db..1ceb394 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN docker-php-ext-enable rdkafka \ && rm -rf /php-rdkafka # Install PHP extensions zip, mbstring, exif, bcmath, intl -RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-configure gd RUN docker-php-ext-install zip mbstring exif pcntl bcmath -j$(nproc) gd intl # Install Redis and enable it From 33852f15662f034a0b76befc52882ebd0978b8d2 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Tue, 21 Jun 2022 10:44:19 +0200 Subject: [PATCH 2/4] Fix Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1ceb394..104e4f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,7 @@ RUN docker-php-ext-enable rdkafka \ RUN docker-php-ext-configure gd 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 From 90387daeda0d16f5295a407f3c6fdb14cdb12d22 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Tue, 21 Jun 2022 20:01:57 +0200 Subject: [PATCH 3/4] Add Supervisord custom process number --- Dockerfile | 1 + entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 104e4f2..4f7f7d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM php:7.2-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 \ diff --git a/entrypoint.sh b/entrypoint.sh index 4b3e8e0..6bed832 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 From f4791880935af95d6961e62fed8097d947b52d48 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Tue, 21 Jun 2022 20:02:29 +0200 Subject: [PATCH 4/4] Add Supervisord custom process number --- entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6bed832..3abd28b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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