Skip to content

Commit b811fa1

Browse files
GeneralJerelclaude
andcommitted
feat: add Render deployment blueprint and prepare for production
Add render.yaml with two services: a public Docker-based Next.js frontend and a private Python LangGraph agent. Normalize the LANGGRAPH_DEPLOYMENT_URL to handle Render's bare host:port format, and make MCP server configuration opt-in via env var instead of hardcoding the excalidraw default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6a00ff7 commit b811fa1

File tree

3 files changed

+61
-8
lines changed

3 files changed

+61
-8
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ bun.lockb
6060

6161
# Demos
6262
.demos
63+
64+
# References
65+
.references

apps/app/src/app/api/copilotkit/route.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ import {
66
import { LangGraphAgent } from "@copilotkit/runtime/langgraph";
77
import { NextRequest } from "next/server";
88

9+
// Normalize Render's fromService hostport (bare host:port) into a full URL
10+
const raw = process.env.LANGGRAPH_DEPLOYMENT_URL;
11+
const deploymentUrl = !raw
12+
? "http://localhost:8123"
13+
: raw.startsWith("http")
14+
? raw
15+
: `http://${raw}`;
16+
917
// 1. Define the agent connection to LangGraph
1018
const defaultAgent = new LangGraphAgent({
11-
deploymentUrl: process.env.LANGGRAPH_DEPLOYMENT_URL || "http://localhost:8123",
19+
deploymentUrl,
1220
graphId: "sample_agent",
1321
langsmithApiKey: process.env.LANGSMITH_API_KEY || "",
1422
});
@@ -21,13 +29,15 @@ export const POST = async (req: NextRequest) => {
2129
runtime: new CopilotRuntime({
2230
agents: { default: defaultAgent, },
2331
a2ui: { injectA2UITool: true },
24-
mcpApps: {
25-
servers: [{
26-
type: "http",
27-
url: process.env.MCP_SERVER_URL || "https://mcp.excalidraw.com",
28-
serverId: "example_mcp_app",
29-
}],
30-
},
32+
...(process.env.MCP_SERVER_URL && {
33+
mcpApps: {
34+
servers: [{
35+
type: "http",
36+
url: process.env.MCP_SERVER_URL,
37+
serverId: "mcp_app",
38+
}],
39+
},
40+
}),
3141
}),
3242
});
3343

render.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
services:
2+
# ── Agent (LangGraph Python) — private, not exposed to internet ──
3+
- type: pserv
4+
name: open-generative-ui-agent
5+
runtime: python
6+
plan: starter
7+
rootDir: apps/agent
8+
buildCommand: "pip install uv && uv sync --frozen"
9+
startCommand: "uv run langgraph dev --host 0.0.0.0 --port $PORT --no-browser --no-reload"
10+
envVars:
11+
- key: PYTHON_VERSION
12+
value: "3.12"
13+
- key: OPENAI_API_KEY
14+
sync: false
15+
- key: LANGSMITH_API_KEY
16+
sync: false
17+
buildFilter:
18+
paths:
19+
- apps/agent/**
20+
21+
# ── Frontend (Next.js) — public web service ──
22+
- type: web
23+
name: open-generative-ui-app
24+
runtime: docker
25+
plan: starter
26+
dockerfilePath: docker/Dockerfile.app
27+
envVars:
28+
- key: LANGGRAPH_DEPLOYMENT_URL
29+
fromService:
30+
name: open-generative-ui-agent
31+
type: pserv
32+
property: hostport
33+
- key: LANGSMITH_API_KEY
34+
sync: false
35+
buildFilter:
36+
paths:
37+
- apps/app/**
38+
- package.json
39+
- pnpm-lock.yaml
40+
- docker/Dockerfile.app

0 commit comments

Comments
 (0)