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