perf(deploy): pre-install node_modules in CI and enable always-on to fix slow cold start

- CI now runs pnpm install and includes node_modules in the zip artifact
- startup.sh simplified: removed pnpm install fallback, uses direct bin path instead of npx
- Azure Web App always-on enabled to prevent cold starts

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gongzhiyong
2026-04-10 15:55:38 +08:00
co-authored by Claude Sonnet 4.6
parent 370726c811
commit 3263b15554
2 changed files with 12 additions and 16 deletions
+11 -3
View File
@@ -25,15 +25,23 @@ jobs:
with:
node-version: "20"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: |
cd langgraph
pnpm install --frozen-lockfile
- name: Package for deployment
run: |
cd langgraph
# Create langgraphjs dev prerequisites
touch .env
mkdir -p .langgraph_api
# Package source only — Oryx will install node_modules on Azure
zip -r ../deploy-langgraph.zip . \
-x "node_modules/*" ".git/*" "dist/*" ".DS_Store"
-x ".git/*" "dist/*" ".DS_Store"
- name: Login to Azure
uses: azure/login@v2
+1 -13
View File
@@ -9,17 +9,5 @@ cd /home/site/wwwroot
touch .env
mkdir -p .langgraph_api
# Install pnpm globally if not available
if ! command -v pnpm &> /dev/null; then
echo "Installing pnpm..."
npm install -g pnpm@10
fi
# Install dependencies if node_modules is missing (Oryx should have done this, but fallback)
if [ ! -d "node_modules" ]; then
echo "node_modules not found, installing dependencies..."
pnpm install --frozen-lockfile
fi
echo "Starting LangGraph server on port ${PORT:-8080}..."
exec npx langgraphjs dev --host 0.0.0.0 --port ${PORT:-8080} --no-browser
exec ./node_modules/.bin/langgraphjs dev --host 0.0.0.0 --port ${PORT:-8080} --no-browser