Created
October 23, 2015 09:31
-
-
Save lanwen/93a9956c80a3d56f7748 to your computer and use it in GitHub Desktop.
Entrypoint example with waiter for port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cp config/local.tpl config/local.yml | |
export DB_TCP="/dev/tcp/${DB_1_PORT_3306_TCP_ADDR}/${DB_1_PORT_3306_TCP_PORT}" | |
# See http://tldp.org/LDP/abs/html/devref1.html for description of this syntax. | |
while ! exec 6<>${DB_TCP}; do | |
echo "$(date) - still trying to connect to mysql at ${DB_TCP}" | |
sleep 1 | |
done | |
bundle exec rake db:migrate | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment