chore: lock start to node22 and rebuild sqlite deps

This commit is contained in:
Esdras Renan 2025-11-19 20:24:56 -03:00
parent 60da918434
commit 7508bd5f82

View file

@ -22,6 +22,7 @@ if command -v apt-get >/dev/null 2>&1; then
apt-get update -y || true
apt-get install -y --no-install-recommends curl ca-certificates gnupg || true
fi
install_node() {
local current_node_major=""
if command -v node >/dev/null 2>&1; then
@ -37,6 +38,10 @@ install_node() {
apt-get install -y --no-install-recommends nodejs || true
}
# Base toolchain for native modules
apt-get update -y || true
apt-get install -y --no-install-recommends build-essential python3 make pkg-config || true
if ! command -v openssl >/dev/null 2>&1; then
echo "[start-web] openssl not found; installing via apt-get (requires root)"
apt-get update -y || true
@ -76,13 +81,9 @@ fi
echo "[start-web] launching Next.js"
PORT=${PORT:-3000}
if command -v node >/dev/null 2>&1; then
NODE_MAJOR=$(node -v | sed -E 's/^v([0-9]+).*/\1/')
if [ -n "$NODE_MAJOR" ] && [ "$NODE_MAJOR" -ge 20 ]; then
NODE_MAJOR=$(command -v node >/dev/null 2>&1 && node -v | sed -E 's/^v([0-9]+).*/\1/' || echo "")
if [ -z "$NODE_MAJOR" ] || [ "$NODE_MAJOR" -lt 20 ]; then
echo "[start-web] Node.js 20+ not available; aborting"
exit 1
fi
exec node node_modules/next/dist/bin/next start --port "$PORT"
else
echo "[start-web] node version ($NODE_MAJOR) < 20; using bun to start Next.js"
fi
fi
# Fallback to bun if node is unavailable or too old
exec bun run start -- --port "$PORT"