fix: ensure pnpm is available in web entrypoint
This commit is contained in:
parent
0f835efc3e
commit
2980885bf8
1 changed files with 25 additions and 2 deletions
|
|
@ -7,8 +7,31 @@ echo "[start-web] Node: $(node -v || true)"
|
|||
cd /app
|
||||
|
||||
# Ensure pnpm available in this base image
|
||||
corepack enable >/dev/null 2>&1 || true
|
||||
corepack prepare pnpm@9 --activate >/dev/null 2>&1 || true
|
||||
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:-}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue