diff --git a/entrypoint.sh b/entrypoint.sh index 72908cb..14b1793 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,18 @@ #!/bin/sh set -e -./oauth-mock-server \ No newline at end of file +# Start the OAuth mock server in the background +/oauth-mock-server & + +# Wait for the server to be ready +for i in $(seq 1 30); do + if curl -s http://localhost:${PORT:-8080}/authorize > /dev/null; then + echo "OAuth mock server is up and running" + exit 0 + fi + echo "Waiting for OAuth mock server to be ready..." + sleep 1 +done + +echo "Failed to start OAuth mock server" +exit 1 \ No newline at end of file