mirror of
https://github.com/usetrmnl/inker.git
synced 2026-04-29 13:45:07 -07:00
10 lines
382 B
Plaintext
10 lines
382 B
Plaintext
#!/command/with-contenv sh
|
|
# Wait for backend to be ready before accepting connections
|
|
# Prevents 502 errors when devices connect during startup
|
|
echo "[nginx] Waiting for backend..."
|
|
until bun -e "const r=await fetch('http://127.0.0.1:3002/health');process.exit(r.ok?0:1)" 2>/dev/null; do
|
|
sleep 1
|
|
done
|
|
echo "[nginx] Backend is ready, starting nginx"
|
|
exec nginx -g "daemon off;"
|