Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Supervisor? #44

Open
jacksun101 opened this issue Jan 8, 2021 · 1 comment
Open

Enable Supervisor? #44

jacksun101 opened this issue Jan 8, 2021 · 1 comment

Comments

@jacksun101
Copy link

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=%(program_name)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?

@petehalverson
Copy link
Member

petehalverson commented Jan 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants