start.sh 257 B

12345678910111213141516
  1. #!/bin/sh
  2. echo "Connecting to ${DB_HOST}:${DB_PORT}"
  3. while true; do
  4. nc -z ${DB_HOST} ${DB_PORT} && break
  5. echo "Unable to connect to ${DB_HOST}:${DB_PORT}; sleeping"
  6. sleep 1
  7. done
  8. echo "Waiting for database to settle"
  9. sleep 3
  10. go run main.go