refactor: migrate LangGraph server from Container App to Azure Web App

## Changes
- Delete Dockerfile and .dockerignore (no longer needed)
- Rewrite deploy-langgraph.yml: zip deploy to Web App (not ACR build)
- Update deploy-langgraph-ui.yml: VITE_LANGGRAPH_URL → soc-langgraph.azurewebsites.net

## Azure Resources
- CREATED: soc-langgraph Web App (Node.js 20, B1 Linux, southeastasia)
- CREATED: soc-langgraph-plan (App Service Plan, B1, southeastasia)
- DELETED: soc-langgraph Container App
- DELETED: soc-cae Container App Environment
- DELETED: socsocacr ACR
- All env vars migrated to Web App
- Startup: npx langgraphjs dev --host 0.0.0.0 --port 2024 --no-browser
- WEBSITES_PORT=2024

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gongzhiyong
2026-04-10 05:47:32 +08:00
co-authored by Claude Opus 4.6
parent 4a485a9c5b
commit 32f83d714e
4 changed files with 28 additions and 49 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ jobs:
- name: Build Vite frontend
working-directory: langgraph
env:
VITE_LANGGRAPH_URL: https://soc-langgraph.jollysand-7f0f231b.southeastasia.azurecontainerapps.io
VITE_LANGGRAPH_URL: https://soc-langgraph.azurewebsites.net
run: pnpm vite build
- name: Deploy to Azure Static Web Apps
+27 -16
View File
@@ -1,4 +1,4 @@
name: Deploy LangGraph Server to Azure Container App
name: Deploy LangGraph Server to Azure Web App
on:
push:
@@ -20,6 +20,27 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm and dependencies
run: |
npm install -g pnpm@10
cd langgraph
pnpm install --frozen-lockfile
# Create .env placeholder (langgraphjs dev requires it)
touch .env
mkdir -p .langgraph_api
echo ".langgraph_api" >> .gitignore
- name: Package for deployment
run: |
cd langgraph
zip -r ../deploy-langgraph.zip . \
-x ".git/*" "dist/*" ".DS_Store"
- name: Login to Azure
uses: azure/login@v2
with:
@@ -27,18 +48,8 @@ jobs:
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_62D66D4E65AC4A6C872064AD668AC691 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5D7B0564A55F4209A91149F2642D3F69 }}
- name: Build and push image to ACR (cloud build)
run: |
az acr build \
--registry socsocacr \
--resource-group Operation \
--image soc-langgraph:${{ github.sha }} \
--image soc-langgraph:latest \
langgraph/
- name: Deploy to Container App
run: |
az containerapp update \
--name soc-langgraph \
--resource-group Operation \
--image socsocacr.azurecr.io/soc-langgraph:${{ github.sha }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: soc-langgraph
package: deploy-langgraph.zip
-6
View File
@@ -1,6 +0,0 @@
node_modules
.git
dist
.env
*.local
.DS_Store
-26
View File
@@ -1,26 +0,0 @@
FROM node:20-slim
# Install pnpm
RUN npm install -g pnpm@10
WORKDIR /app
# Copy package files and install dependencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# langgraphjs dev requires .env to exist, and writes .langgraph_api + .gitignore on startup
# Pre-create these to prevent tsx file watcher from triggering a restart loop
RUN touch .env && \
mkdir -p .langgraph_api && \
echo ".langgraph_api" >> .gitignore
# Expose LangGraph server port
EXPOSE 2024
# Use langgraphjs dev with explicit host binding
# The --host flag ensures it binds to 0.0.0.0 not just localhost
CMD ["pnpm", "exec", "langgraphjs", "dev", "--host", "0.0.0.0", "--port", "2024", "--no-browser"]