I have a dockerized plotly-Dash Flask app pushed to AWS Elastic Container Registry and running on the Elastic Container Service. It communicates fine with my RDS database on the same account.
Currently, data gets pulled from within the Flask app on every refresh of the page, but I would like to be able to trigger the Flask app to pull the data from RDS (once daily at possibly different times day to day, if that makes a difference).
The only way I've found so far is changing the structure so that it is only pulling the data once in the script before the Flask app is started, and then killing the task/restarting a new task every day. This shouldn't be the only way to do this and I'm sure someone here knows a much better way.
My hope would be this:
- Python script connects to MySQL db on RDS
- Pulls data to pandas df
- Uses data for Flask app
- I can trigger a new pull of the data without having to kill the task.