docker-compose-laravel
docker-compose-laravel copied to clipboard
How to run queue worker?
As the title says, how to run queue worker in laravel on production environment?
You can add a service for it using the php image
queue:
image: php
restart: unless-stopped
command: bash -c 'php artisan queue:work;'
container_name: queue
depends_on:
- redis
volumes:
- ./src:/var/www/html:delegated
working_dir: /var/www/html
networks:
- laravel
Thankyou for the response, but it still won't work, my queue still stuck in the database.
Can you share me your full working docker-compose.yml
file please @thrashzone13?
You can run using docker-compose run --rm artisan queue:work
Will it run indefinitely or will it shutdown after I exit the console?
That command is just to run it on your local machine. If you want it to run indefinitely you need to add supervisord service in docker and run it.
Will it run indefinitely or will it shutdown after I exit the console?
-- Best Regards, Kevin Yobeth On 24 Jun 2022 12.36 PM +0700, Sanket Gandhi @.***>, wrote:
You can run using docker-compose run --rm artisan queue:work — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
If you want to run the queue locally docker-compose run --rm artisan queue:work
but it will stop after you ctrl+c or exit the console.
If you want to run it indefinitely you'll need to take @sanketgandhi876 advice and set up a supervisord service for it.