Skip to content

Instantly share code, notes, and snippets.

@humbhenri
Created November 18, 2017 23:25
Show Gist options
  • Save humbhenri/e37f85845b7f647a650cb8a0cab2be0e to your computer and use it in GitHub Desktop.
Save humbhenri/e37f85845b7f647a650cb8a0cab2be0e to your computer and use it in GitHub Desktop.
Executa Mysql via Docker e o jar do Projeto instalura do curso de React do Alura
SPRING_LOG_FILE=/tmp/spring_alura.log
rm $SPRING_LOG_FILE
docker stop alura
docker run --rm --name alura -e MYSQL_ROOT_PASSWORD=123 -p3306:3306 -d mysql:5.6
sleep 1
while ! docker logs alura 2>&1 | grep 'ready for connections'; do
sleep 1
echo Esperando mysql subir no container Docker...
done
echo Iniciando Spring Boot
java -jar -Dspring.datasource.password=123 ~/Downloads/instalura.jar &> $SPRING_LOG_FILE &
sleep 1
while ! grep -m1 'Started Boot' < $SPRING_LOG_FILE; do
echo Esperando Spring Boot...
sleep 1
done
curl http://localhost:8080/gera/dados
echo Começou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment