summaryrefslogtreecommitdiff
path: root/scripts/entrypoint.sh
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-10 23:50:58 +0530
committerBobby <[email protected]>2026-03-10 23:50:58 +0530
commitfd9d558154eac3585310626f697b943d90e1bf7f (patch)
tree90f88ce4a0ad68a71d8431990754bb7e04b18101 /scripts/entrypoint.sh
parenta3a6c652dfdc450f014df0a67b0890acdec4a7ce (diff)
downloadpagoda-fd9d558154eac3585310626f697b943d90e1bf7f.tar.xz
pagoda-fd9d558154eac3585310626f697b943d90e1bf7f.zip
feat: add support for LibSQL database driver and enhance seeding process
Diffstat (limited to 'scripts/entrypoint.sh')
-rw-r--r--scripts/entrypoint.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh
new file mode 100644
index 0000000..3ff3886
--- /dev/null
+++ b/scripts/entrypoint.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -e
+
+./shrine &
+SHRINE_PID=$!
+
+if [ "$SEED" = "true" ]; then
+ RETRIES=0
+ MAX_RETRIES=30
+ until bash -c "echo > /dev/tcp/localhost/${PORT:-3000}" 2>/dev/null; do
+ RETRIES=$((RETRIES + 1))
+ if [ "$RETRIES" -ge "$MAX_RETRIES" ]; then
+ echo "Server failed to start after ${MAX_RETRIES}s"
+ exit 1
+ fi
+ sleep 1
+ done
+ bash scripts/seed.sh
+fi
+
+wait $SHRINE_PID \ No newline at end of file