Wait for containers to be up and running

This commit is contained in:
cytopia
2018-03-04 11:37:09 +01:00
parent f3a1c69dd9
commit b373e89560

View File

@@ -61,8 +61,11 @@ name="$( docker_name "${did}" )"
# Start Nginx
ndid="$( docker_run "${CONTAINER}" "-v ${DOC_ROOT_HOST}:${DOC_ROOT_CONT} -v ${CONFIG_HOST}:${CONFIG_CONT} -p ${WWW_PORT}:80 --link ${name}" )"
# Wait for both containers to be up and running
run "sleep 10"
# Check PHP connectivity
if ! run "curl -q 127.0.0.1:${WWW_PORT}/index.php 2>&1 | grep '${FINDME}'"; then
if ! run "curl -q localhost:${WWW_PORT}/index.php 2>&1 | grep '${FINDME}'"; then
docker_logs "${ndid}" || true
docker_logs "${did}" || true
docker_stop "${ndid}" || true