From ca3d31b5f5a41750fdca60f6905cf93d886b6cb5 Mon Sep 17 00:00:00 2001 From: Shaharia Azam Date: Sun, 1 Sep 2024 23:30:03 +0200 Subject: [PATCH] Updated dockerfile --- entrypoint.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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