I am trying to run a python script recurringly that sends out emails. The script retrieves information about emails etc from the database that my application's backend API uses. This backend is already deployed as a service in my ECS cluster. I am trying to set up a scheduled task but from what I understand it creates a new docker instance in order to run it. Is there a way to run this task in the already existing docker instance that is active at all times and acts as the API server.
I tried to create a scheduled task but from what it looks like it creates a new docker instance every time it runs and as the script is a short and nondemanding one this seems wasteful. Also I am not sure about Lambda functions as I need to access the database inside the ECS container.