docker: add delayed job worker to compose file.
This commit is contained in:
16
bin/wait-for-http
Executable file
16
bin/wait-for-http
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Script to wait until an http service is ready. Used by the Docker Compose
|
||||
# file to wait until services are ready.
|
||||
#
|
||||
# Usage: bin/wait-for-http 3s http://google.com && echo ready
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
URL="$1"
|
||||
DELAY="${2:-3s}"
|
||||
|
||||
until curl -sL "$URL" > /dev/null; do
|
||||
echo "$URL not up yet; retrying in $DELAY"
|
||||
sleep "$DELAY"
|
||||
done
|
||||
Reference in New Issue
Block a user