Skip to content

Enable Supervisor? #44

@jacksun101

Description

@jacksun101

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions