Scheduling docker container vs persistent container with scheduled tasks within it

Viewed 198

I have a docker file which runs a python script which should periodically (every 20 minutes) download a json file with an api call.

As far as I can see I can choose between two options to schedule this job:

  1. Within Python using e.g. apscheduler, shed or schedule
  2. Schedule the docker file using cron or systemd timers

Questions:

  • Have I missed any options?
  • In general, under what conditions would one chose one over the other?
  • Am I correct in assuming option 2. is preferable for my particular case?
0 Answers
Related