Open jacksun101 opened 3 years ago
@jacksun101 Yes, that makes sense. I've introduced SUPERVISOR in other images for other purposes (e.g. octodock), but hesitate to suggest it for a worker. I see the benefits of creating a separate worker container.
What is the advantage to introducing another process for this in the container over the default sync
?
That said, maybe support for a SUPERVISOR CRON process makes more sense than the current examples.
Thoughts?
Can we have an additional variable like ENABLE_SUPERVISOR? And this is going to install the supervisor, config file and run. For the sake of database queues. For example, it might look like this.
Dockerfile RUN apt-get update && apt-get install -y supervisor COPY october-worker.conf /etc/supervisor/conf.d/october-worker.conf ADD ./run.sh /run.sh RUN chmod a+x /run.sh
run.sh
!/bin/sh
set -e php artisan october:up exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
october-worker.conf [program:october-worker] process_name=%(programname)s%(process_num)02d command=/usr/local/bin/php /var/www/html/artisan queue:work --sleep=3 --tries=3 autostart=true autorestart=true user=root numprocs=4 redirect_stderr=true stdout_logfile=/var/www/html/worker.log
Making sense?