fix: ensure pnpm is available in web entrypoint

This commit is contained in:
Esdras Renan 2025-10-16 22:13:03 -03:00
parent 0f835efc3e
commit 2980885bf8

View file

@ -7,8 +7,31 @@ echo "[start-web] Node: $(node -v || true)"
cd /app
# Ensure pnpm available in this base image
ensure_pnpm() {
if command -v pnpm >/dev/null 2>&1; then
return 0
fi
if command -v corepack >/dev/null 2>&1; then
corepack enable >/dev/null 2>&1 || true
corepack prepare pnpm@9 --activate >/dev/null 2>&1 || true
fi
if command -v pnpm >/dev/null 2>&1; then
return 0
fi
if command -v npm >/dev/null 2>&1; then
npm install -g pnpm@9 >/dev/null 2>&1
fi
if ! command -v pnpm >/dev/null 2>&1; then
echo "[start-web] pnpm not available; aborting startup" >&2
exit 1
fi
}
ensure_pnpm
echo "[start-web] Using APP_DIR=$(pwd)"
echo "[start-web] NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-}"