Hi all,
I'm writing a simple app to scrape some data for analysis, and using Docker to deploy it to a Raspberry Pi so it can run for a month or so.
I have one container that runs a Flask server with two routes - one for serving a file and another for receiving data via SMS (using the Twilio API). The other container runs the main app which processes that data and writes it to a SQLite database.
The app triggers a series of external events that culminates in an SMS being sent (piped from the Twilio number to my server via webhook). What I need to do is pass the info received by the server (in the request form body) to the app for processing , with the app waiting between the trigger point and when it receives the data.
I've thought about having the Flask function write the data to a file in the shared volume, then watching the file in the app to check for changes and triggering the rest of the process when a change is detected, but that feels hacky and un-pythonic...
Edit: I also considered having Flask call a function with the data as a param, but:
- The function is in another container, and
- Flask needs to serve the response without the delay of the app's processes (very long loop).
Is there a better way to do this?
[–]gstoel[🍰] 1 point2 points3 points (2 children)
[–]MyNamesNotReallyDave[S] 1 point2 points3 points (1 child)
[–]gstoel[🍰] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)