My application is a Python Django running on a docker container.This application has a cron job that keeps updating the data in a database. Should I put this cron job into a separate container because I read some documents mentioning that I should redirect to cron job output to the docker console. Is there any best practice on running cron on a container?
1 Answer
Creating a Docker container in order to execute jobs to other containers is a good practice, If You have a separate container for databases and one for your Django application, it would be a good practice to have a separate docker container running for cron jobs, as with the time your project might grow and you would have a centralized crontab by that time ready to be used. As how to do it there is a nice article describing how to do this: Creating a Docker container in order to execute jobs to other containers
-
This link provides some good info on running a cronjob in the container.– kokeiJan 12, 2020 at 15:46