I have a Ruby on Rails app in a Docker container on Ubuntu 14.04. I set up my deployments using Dokku but I'm unsure how to get my cron jobs working correctly.
Currently I'm using the whenever gem which allows me to do something simple like:
every 5.minutes do
runner 'MyModel.run_something'
end
The problem is I think that every time I deploy using git push dokku master
it resets the container and setting it back to it's default thus removing all my cron schedules.
So then I thought maybe the cron scheduling needs to be outside the container and at the VM level instead.
I currently don't see any cron jobs running no matter what I do. Here's what happens when I run crontab -l
when ssh'd:
root@dashboard:~# crontab -l
no crontab for root
I'm pretty new to container virtualization so I apologize if I've skipped over a critical part of this but I'm a stumped.
run
too and I'm trying to find a more robust alternative, good call though. – Peeler