Docker + Laravel queue:work

后端 未结 4 1220
耶瑟儿~
耶瑟儿~ 2021-01-02 06:57

I\'m trying to run the following command after the container is up and running.

php artisan queue:work -n -q &

The \"&\" is there b

4条回答
  •  春和景丽
    2021-01-02 07:15

    use supervisor

    apt-get install supervisor

    cd /etc/supervisor/conf.d && sudo nano laravel-worker.conf

    [program:laravel-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=docker exec php php /path/to/artisan queue:work redis --sleep=3 --tries=5
    autostart=true
    autorestart=true
    user=root
    numprocs=8
    redirect_stderr=true
    stdout_logfile=/var/logs/worker.log
    

提交回复
热议问题