Skip to content
A pure Python implementation of wait-for-it.sh with no dependencies
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
requirements
.gitignore
.travis.yml
LICENSE.md
README.md
test_wait_for_it.py
wait_for_it.py

README.md

wait_for_it.py

Build Status

A pure Python implementation of wait-for-it.sh with no dependencies, however if requests is available it will be used.

Intended to be used as a lightweight dependency service checker before startup of apps.

Requirements

Python3+

Usage

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

Optionally specify:

  • --timeout N to wait N seconds before giving up, defaults to 5 seconds.
  • --retry N to wait N seconds between attempts, defaults to 1 second.

Why?

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.

Alternatives

License

MIT

You can’t perform that action at this time.