diff --git a/Dockerfile b/Dockerfile index d6e6d7b..2c6163b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,8 @@ RUN apk update && apk add --no-cache \ nginx \ openssl \ linux-headers \ - supervisor + supervisor \ + && rm -rf /tmp/* /var/cache/apk/* RUN docker-php-ext-configure zip && docker-php-ext-install zip RUN docker-php-ext-install gd pdo pdo_mysql zip @@ -78,7 +79,8 @@ RUN composer install --no-interaction --prefer-dist # Supervisor COPY ./docker/datbrowserQueueWorker.conf /etc/supervisor/conf.d/datbrowserQueueWorker.conf -RUN sudo supervisorctl reread && sudo supervisorctl reread && sudo supervisorctl update +COPY ./docker/supervisord.conf /etc/supervisord.conf +# RUN supervisorctl reread && supervisorctl update # CRON RUN echo "* * * * * cd ${wd} && php artisan schedule:run >> /dev/null 2>&1" > /etc/crontabs/root diff --git a/docker/datbrowserQueueWorker.conf b/docker/datbrowserQueueWorker.conf index 4372d3c..fba1a33 100644 --- a/docker/datbrowserQueueWorker.conf +++ b/docker/datbrowserQueueWorker.conf @@ -1,12 +1,12 @@ [program:laravel-worker] process_name=%(program_name)s_%(process_num)02d -command=php %(wd)/artisan queue:work --queue=high,default --tries=3 --timeout=300 --sleep=3 --no-interaction +command=php /var/www/artisan queue:work --queue=high,default --tries=3 --timeout=300 --sleep=3 --no-interaction autostart=true autorestart=true stopasgroup=true killasgroup=true -user=forge -numprocs=8 +user=root +numprocs=1 redirect_stderr=true -stdout_logfile=%(wd)/worker.log +stdout_logfile=/var/www/worker.log stopwaitsecs=3600 diff --git a/docker/supervisord.conf b/docker/supervisord.conf new file mode 100644 index 0000000..4b4f8c7 --- /dev/null +++ b/docker/supervisord.conf @@ -0,0 +1,7 @@ +[supervisord] +nodaemon=true +user=root + +[include] +files = /etc/supervisor/conf.d/*.conf + diff --git a/dockerEntryPoint.sh b/dockerEntryPoint.sh index 2e65bbd..c5a4630 100644 --- a/dockerEntryPoint.sh +++ b/dockerEntryPoint.sh @@ -7,6 +7,7 @@ php ./artisan migrate --force php ./artisan optimize:clear && php ./artisan optimize # Queue worker +supervisord --nodaemon --configuration /etc/supervisord.conf supervisorctl start "laravel-worker:*" # Start all of the server sumulataneously