devilbox icon indicating copy to clipboard operation
devilbox copied to clipboard

Custom supervisor configs

Open stu177 opened this issue 6 years ago • 9 comments

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 avatar Mar 30 '20 14:03 stu177

@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 avatar Mar 30 '20 14:03 cytopia

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

stu177 avatar Mar 30 '20 14:03 stu177

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.

stale[bot] avatar Jun 28 '20 15:06 stale[bot]

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.

stale[bot] avatar Oct 02 '20 06:10 stale[bot]

@stu177 Will be addressed here: https://github.com/devilbox/docker-php-fpm/pull/181

cytopia avatar Nov 21 '20 14:11 cytopia

Fix released here: https://github.com/cytopia/devilbox/pull/757

cytopia avatar Nov 22 '20 16:11 cytopia

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!

masiorama avatar May 10 '22 16:05 masiorama

[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

izdrail avatar Apr 15 '23 12:04 izdrail

@Cornatul thanks, I will give it a try asap!

masiorama avatar Apr 16 '23 06:04 masiorama