I have a Django project in a Docker container that is being deployed to AWS Elastic Container Service. I would like to have a Django command execute on a weekly basis, but I am unsure what is the best practice for doing this.
Is this something I can/should set up as part of the Docker/Django project itself?
Would I be better using something like AWS Lambda or Batch to schedule this? If so, how do I access this script in my Django deployment?
I think there are several broad strokes ideas you could use:
That's all you! There are a lot of options
I've used these before and they're quite robust and reliable: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
This is pretty simple and straightforward. This would be my pick if I had only this one thing I had to do once a week and I knew it wasn't going to grow, or only have very infrequently running jobs. https://pypi.org/project/django-crontab/
This one is a lot of work but if you end up with a lot of background tasks it can be quite worthwhile to setup as it's very inspectable and you can trigger jobs manually from the django admin.
https://docs.celeryproject.org/en/stable/django/first-steps-with-django.html