Last active
March 28, 2018 02:28
-
-
Save aarshtalati/b3be0b1948eb8a263c0a4a6dc4afeee3 to your computer and use it in GitHub Desktop.
makes sure that database docker container is up and spinning before starting Java SpringBoot application
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 | |
while ! exec 6<>/dev/tcp/${DATABASE_HOST}/${DATABASE_PORT}; do | |
echo "Trying to connect to MySQL at ${DATABASE_HOST}:${DATABASE_PORT}..." | |
sleep 10 | |
done | |
echo ">> connected to MySQL database! <<" | |
java -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=container -jar /app.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment