Closed vahidalvandi closed 1 year ago
i slove this by install supervisior , if you have beter solution please develop it
sudo apt-get update -y
sudo apt-get install supervisor
supervisord -v
systemctl status supervisor
nano /etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=docker compose -f /media/user/disk/laravel/docker-test/docker-compose.yml exec app php artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-queue.log
stopwaitsecs=3600
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker:*
@vahidalvandi you need to install supervisor in order to queue worker to work in production.
Check this Laravel official documentation.
So your solution is exactly how to solve this problem 😉
thank you . please show me how i can run queue ?