Files
socaichat/docker-compose.yml
T
gongzhiyong d878135443
Deploy LangGraph Server to Azure Web App / build-and-deploy (push) Failing after 12s
Deploy LangGraph UI to Azure Static Web Apps / build-and-deploy (push) Failing after 1m7s
fix: Vite proxy for Docker — frontend routes API through same-origin proxy to langgraph-dev:2024
2026-04-11 12:28:52 +08:00

114 lines
3.6 KiB
YAML

# SOC Chat Clone - Local Docker (lightweight)
# 基础设施用 Azure 云服务,本地只运行 LangGraph Server + Frontend
#
# Usage:
# make dev - 开发模式(热重载)
# make prod - 生产模式
# make down - 停止
services:
# ============================================================
# Backend - Development (hot reload, source mount)
# ============================================================
langgraph-dev:
container_name: soc-langgraph-dev
profiles: ["dev"]
build:
context: ./langgraph
dockerfile: Dockerfile.dev
env_file:
- ./langgraph/.env
ports:
- "2024:2024"
volumes:
- ./langgraph/src:/app/src:cached
- ./langgraph/langgraph.json:/app/langgraph.json:ro
- ./langgraph/index.html:/app/index.html:ro
- ./langgraph/vite.config.ts:/app/vite.config.ts:ro
- ./langgraph/tsconfig.json:/app/tsconfig.json:ro
- ./langgraph/tsconfig.app.json:/app/tsconfig.app.json:ro
- ./langgraph/tsconfig.node.json:/app/tsconfig.node.json:ro
- ./langgraph/tailwind.config.js:/app/tailwind.config.js:ro
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:2024/ok || exit 1"]
interval: 10s
timeout: 5s
retries: 15
start_period: 30s
# ============================================================
# Backend - Production (optimized image)
# ============================================================
langgraph-prod:
container_name: soc-langgraph-prod
profiles: ["prod"]
build:
context: ./langgraph
dockerfile: Dockerfile.prod
env_file:
- ./langgraph/.env
ports:
- "2024:2024"
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:2024/ok || exit 1"]
interval: 10s
timeout: 5s
retries: 15
start_period: 30s
restart: unless-stopped
# ============================================================
# Frontend - Development (Vite dev server with HMR)
# ============================================================
frontend-dev:
container_name: soc-frontend-dev
profiles: ["dev"]
build:
context: ./langgraph
dockerfile: Dockerfile.frontend.dev
environment:
# VITE_LANGGRAPH_URL is empty so browser uses same-origin (proxy handles it)
# LANGGRAPH_BACKEND_URL is used by Vite proxy (server-side, Docker internal DNS)
- VITE_LANGGRAPH_URL=
- LANGGRAPH_BACKEND_URL=http://langgraph-dev:2024
ports:
- "5173:5173"
volumes:
- ./langgraph/src:/app/src:cached
- ./langgraph/index.html:/app/index.html:ro
- ./langgraph/vite.config.ts:/app/vite.config.ts:ro
- ./langgraph/tailwind.config.js:/app/tailwind.config.js:ro
- ./langgraph/tsconfig.json:/app/tsconfig.json:ro
- ./langgraph/tsconfig.app.json:/app/tsconfig.app.json:ro
- ./langgraph/tsconfig.node.json:/app/tsconfig.node.json:ro
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:5173 || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
# ============================================================
# Frontend - Production (nginx + vite build)
# ============================================================
frontend-prod:
container_name: soc-frontend-prod
profiles: ["prod"]
build:
context: ./langgraph
dockerfile: Dockerfile.frontend.prod
args:
VITE_LANGGRAPH_URL: http://localhost:2024
ports:
- "3000:3000"
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:3000 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped