start.sh 242 B

123456789101112
  1. #!/bin/bash
  2. source ./scripts/_functions.sh
  3. docker-compose up -d
  4. regex="80\/tcp -> 0\.0\.0\.0:([0-9]+)"
  5. if [[ $(docker port mysite) =~ $regex ]]
  6. then
  7. port="${BASH_REMATCH[1]}"
  8. echo "View the project at: http://localhost:${port}/"
  9. fi