laravel queue service in docker container
I’ve 3 docker containers, php7 nginx and mariadb each are linked up and serve simple wordpress sites.
I’d like to add laravel project to the bunch. It all works great except laravel services that I need to run, e.g. queue listener and scheduler cron. How do you recommend dealing with these?
One Solution collect form web for “laravel queue service in docker container”
You might want to consider using Docker Compose to orchestrate multiple containers together. For example, you’d have a Docker Compose file that declared a Docker network, and three containers:
- Message Queue
- Cron Scheduled Tasks
- Laravel application + PHP + Web Server
As long as you add each of the containers to the same network, they’ll be able to communicate with each other. Another benefit of using Docker Compose is that scaling containers is much easier.
Here’s the reference documentation for Docker Compose YAML files: https://docs.docker.com/compose/compose-file/