I am a Laravel developer preparing to use fly.io. However, I am currently perplexed by a problem. I plan to use cron on fly.io, but it seems that cron requires starting a separate virtual machine instance. Do I have to pay for a separate virtual machine just for the cron functionality? How can I optimize this?
1 Like
Good question.
If you have a single machine this can be quite simple: you can configure your crontab to run by your Dockerfile and things should just work
If you have multiple machines for the same app and you want to optimize for fewer machines as possible you could choose one of your machines to be the cron runner. Simply set an environment variable just for that machine and make sure your cron runner only runs if that variable is set.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.