Anyone?
Run the scheduler in a docker image?
We are trying to decide the best way to run the scheduler in a docker container. Given that the php /path/to/artisan schedule:run >> /dev/null 2>&1 command runs & then exits, you cannot let it be the CMD for the Docker file unless you launch a new container for each minute to run the scheduler. We have 3 options that are considering...
-
Have a shell script for the CMD that is in a loop that calls
php /path/to/artisan schedule:run >> /dev/null 2>&1& then sleeps for the balance of a minute -
Add a new artisan command like
schedule:loopthat does what #1 above does but in php. Then use the artisan command as the CMD for the docker file -
Have the docker scheduler launch a new container every minute with an image that has the
php /path/to/artisan schedule:run >> /dev/null 2>&1as the CMD
For any of you that are running laravel in docker, how are you solving this issue?
Please or to participate in this conversation.