Skip to content

Instantly share code, notes, and snippets.

@aarshtalati
Last active Mar 28, 2018
Embed
What would you like to do?
makes sure that database docker container is up and spinning before starting Java SpringBoot application
#!/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