Files
socweb/langgraph/startup.sh
T
gongzhiyongandClaude Opus 4.6 45685e8b4a fix: resolve Web App startup timeout — exclude node_modules from zip, add startup.sh, increase timeout to 600s
- Remove node_modules from deploy zip (302MB -> ~1MB), let Oryx build on Azure
- Add startup.sh: creates .env/.langgraph_api prereqs, installs pnpm, runs langgraphjs dev
- Azure config: WEBSITES_CONTAINER_START_TIME_LIMIT=600, SCM_DO_BUILD_DURING_DEPLOYMENT=true, ENABLE_ORYX_BUILD=true, PRE_BUILD_COMMAND="npm install -g pnpm@10"
- Delete auto-generated main_soc-langgraph.yml (conflicts with deploy-langgraph.yml)
- Enable Always On to avoid cold starts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 06:17:47 +08:00

26 lines
640 B
Bash
Executable File

#!/bin/bash
set -e
echo "=== LangGraph Server Startup ==="
cd /home/site/wwwroot
# Ensure langgraphjs dev prerequisites exist
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 2024..."
exec npx langgraphjs dev --host 0.0.0.0 --port 2024 --no-browser