mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
21 lines
493 B
Bash
21 lines
493 B
Bash
#!/bin/sh
|
|
|
|
# Wait for the Rust backend (holy-rust:8001) before serving.
|
|
echo "Waiting for backend (holy-rust:8001) to be available..."
|
|
|
|
MAX_RETRIES=30
|
|
COUNT=0
|
|
|
|
while ! nc -z holy-rust 8001; do
|
|
COUNT=$((COUNT + 1))
|
|
if [ $COUNT -ge $MAX_RETRIES ]; then
|
|
echo "Backend timed out after $MAX_RETRIES attempts - starting Nginx anyway"
|
|
break
|
|
fi
|
|
echo "Backend is unavailable (attempt $COUNT/$MAX_RETRIES) - sleeping"
|
|
sleep 2
|
|
done
|
|
|
|
echo "Starting Nginx..."
|
|
exec nginx -g "daemon off;"
|