Fix supervisor
All checks were successful
Push image to registry / build-image (push) Successful in 6m46s

This commit is contained in:
2025-02-20 20:00:25 +01:00
parent 51eafce03a
commit 7a03225a21
4 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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

7
docker/supervisord.conf Normal file
View File

@ -0,0 +1,7 @@
[supervisord]
nodaemon=true
user=root
[include]
files = /etc/supervisor/conf.d/*.conf

View File

@ -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