Docker + Laravel queue:work

后端 未结 4 1232
耶瑟儿~
耶瑟儿~ 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:26

    You can't run the queue in the background, otherwise the container stops, as the command has effectively finished. Remove the & and it will stay alive.

    However, you can do something like tail -f /dev/null as the final command to keep the container running if you want to run the queue in the background and still be able to attach to the container and access the shell.

提交回复
热议问题