Custom supervisor configs
ISSUE TYPE
- Feature request
SUMMARY
Custom supervisor configs
Goal
Being able to add custom supervisor conf files to Devilbox would be useful for working with queues in Laravel. I can see that supervisor is installed within the PHP container but I can't see a way of adding a new conf.
@stu177 can you explain what you would like to run with supervisor and also why with supervisor itself?
There is already a possibility to run things: https://devilbox.readthedocs.io/en/latest/autostart/custom-scripts-per-php-version.html
Let me know if this solves your issue already.
@cytopia It's mainly to replicate the environment we have on a production server. The conf we run looks like:
[program:queue-production]
directory=/home/website/www/production/current/
command=php artisan queue:work --tries=3 --sleep=3 --daemon
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
user=user
numprocs=4
redirect_stderr=true
stdout_logfile=/home/website/www/production/current/storage/logs/queue.log
I can always run the command manually on the box to run the artisan command but it's more of a task to mirror the live environment for testing.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@stu177 Will be addressed here: https://github.com/devilbox/docker-php-fpm/pull/181
Fix released here: https://github.com/cytopia/devilbox/pull/757
Hello @stu177 how did you configure supervisor on devilbox? I encountered this argument here https://laravel.com/docs/9.x/queues#configuring-supervisor and I would like to try to do the same you probably already accomplished. Thanks!
[program:queue-production] directory=/home/website/www/production/current/ command=php artisan queue:work --tries=3 --sleep=3 --daemon process_name=%(program_name)s_%(process_num)02d autostart=true autorestart=true user=user numprocs=4 redirect_stderr=true stdout_logfile=/home/website/www/production/current/storage/logs/queue.log
Create a file in the /path/devilbox/supervisor/ named queue.conf restart the docker devilbox
[program:queue-production] directory=/shared/httpd/news/ command=php artisan queue:work --tries=3 --sleep=3 --daemon process_name=%(program_name)s_%(process_num)02d autostart=true autorestart=true numprocs=10 redirect_stderr=true stdout_logfile=/shared/httpd/news/storage/logs/queue.log
and replace /news/to your project
@Cornatul thanks, I will give it a try asap!