Queue Worker Doesn't Work In Two Containers #225
-
Hi everyone, currently I try to implement Laravel Job Batching using Laravel Queue Worker in Docker. Based on ServerSide Up's documentation, it recommends to run queue worker on separate container. So, I have two containers: one for laravel web app and another one for laravel queue worker. Those containers use the same docker image. I create Docker image that wrap serversideup/docker-php (php8.2-fpm-nginx) with my Laravel web app. When I try to test job batching with those containers, the queue worker doesn't work as video below. But, when I just use one container the queue worker works as video below. Here's my repository that reproduce those steps above: https://github.com/kresnasatya/livewire-usecase I'm using Laravel version 10. I'm curious what are the things that I'm missing in order to make queue worker works on separate containers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
what is QUEUE_CONNECTION you using? |
Beta Was this translation helpful? Give feedback.
The jobs records saved in app container and doesn't share record with queue container. Hmm, I think it's because of the database I'm using is sqlite instead of MySQL or Redis. I will try it later. Here's the gif.
Update: I'm using MySQL as DATABASE_CONNECTION and Redis as QUEUE_CONNECTION. Now, it works! I don't use SQLite because the database doesn't share connection or data between two containers.