Intended to be used as a lightweight dependency service checker before startup of apps.
Copy and paste the script into your deployable and prepend the startup of your app with the check for a required service:
python wait_for_it.py http://localhost:1234 && start_my_app
--timeout Nto wait N seconds before giving up, defaults to 5 seconds.
--retry Nto wait N seconds between attempts, defaults to 1 second.
I kept using variations of this script in Python Docker entry points and didn't want to pull external packages or copy some impossible to understand bash code, so I decided to write this fairly simple one that people can easily adapt if needed.