Skip to content

Commit ebcb227

Browse files
committed
Remove redundant sed agent URL patches from test Dockerfiles
Source route.ts files now read process.env.AGENT_URL natively (PR CopilotKit#3737), so the build-time sed patches and verification greps are no longer needed. Also removes crewai-crews docker-route-override.ts and its COPY line, since that starter's route.ts already has AGENT_URL support.
1 parent 7991e8a commit ebcb227

8 files changed

Lines changed: 0 additions & 52 deletions

File tree

examples/integrations/adk/docker/Dockerfile.app

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
1414
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('output')){c=c.replace('};',' output: \"standalone\",\n};'); fs.writeFileSync(f,c);}"
1515
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n};'); fs.writeFileSync(f,c);}"
16-
# Patch hardcoded agent URL to read from AGENT_URL env var at runtime
17-
RUN sed -i 's|url: "http://localhost:8000/"|url: process.env.AGENT_URL \|\| "http://localhost:8000/"|' src/app/api/copilotkit/route.ts
18-
RUN grep -q 'process.env.AGENT_URL' src/app/api/copilotkit/route.ts || (echo "ERROR: agent URL patch failed" && exit 1)
1916
RUN npm run build
2017

2118
FROM base AS runner

examples/integrations/agno/docker/Dockerfile.app

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
1414
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n};'); fs.writeFileSync(f,c);}"
1515
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('output')){c=c.replace('};',' output: \"standalone\",\n};'); fs.writeFileSync(f,c);}"
16-
# Patch hardcoded agent URL to read from AGENT_URL env var at runtime
17-
RUN sed -i 's|url: "http://localhost:8000/agui"|url: (process.env.AGENT_URL \|\| "http://localhost:8000") + "/agui"|' src/app/api/copilotkit/route.ts
18-
RUN grep -q 'process.env.AGENT_URL' src/app/api/copilotkit/route.ts || (echo "ERROR: agent URL patch failed" && exit 1)
1916
RUN npm run build
2017

2118
FROM base AS runner

examples/integrations/crewai-crews/docker-route-override.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/integrations/crewai-crews/docker/Dockerfile.app

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ FROM base AS builder
1111
WORKDIR /app
1212
COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
14-
COPY docker-route-override.ts ./src/app/api/copilotkit/route.ts
1514
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('output')){c=c.replace('};',' output: \"standalone\",\n};'); fs.writeFileSync(f,c);}"
1615
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n};'); fs.writeFileSync(f,c);}"
1716
RUN npm run build

examples/integrations/llamaindex/docker/Dockerfile.app

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
1414
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('output')){c=c.replace('};',' output: \"standalone\",\n};'); fs.writeFileSync(f,c);}"
1515
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n};'); fs.writeFileSync(f,c);}"
16-
# Patch hardcoded agent URL to read from AGENT_URL env var at runtime
17-
RUN sed -i 's|url: "http://127.0.0.1:9000/run"|url: (process.env.AGENT_URL \|\| "http://127.0.0.1:9000") + "/run"|' src/app/api/copilotkit/route.ts
18-
RUN grep -q 'process.env.AGENT_URL' src/app/api/copilotkit/route.ts || (echo "ERROR: agent URL patch failed" && exit 1)
1916
RUN npm run build
2017

2118
FROM base AS runner

examples/integrations/ms-agent-framework-dotnet/docker/Dockerfile.app

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ RUN node -e "\
2424
fs.writeFileSync(f, c); \
2525
}"
2626

27-
# Patch hardcoded agent URL to read from AGENT_URL env var at runtime
28-
RUN sed -i 's|url: "http://localhost:8000/"|url: process.env.AGENT_URL \|\| "http://localhost:8000/"|' src/app/api/copilotkit/route.ts
29-
RUN grep -q 'process.env.AGENT_URL' src/app/api/copilotkit/route.ts || (echo "ERROR: agent URL patch failed" && exit 1)
30-
3127
# Build
3228
RUN npm run build
3329

examples/integrations/ms-agent-framework-python/docker/Dockerfile.app

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
1414
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n};'); fs.writeFileSync(f,c);}"
1515
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('output')){c=c.replace('};',' output: \"standalone\",\n};'); fs.writeFileSync(f,c);}"
16-
# Patch hardcoded agent URL to read from AGENT_URL env var at runtime
17-
RUN sed -i 's|url: "http://localhost:8000/"|url: process.env.AGENT_URL \|\| "http://localhost:8000/"|' src/app/api/copilotkit/route.ts
18-
RUN grep -q 'process.env.AGENT_URL' src/app/api/copilotkit/route.ts || (echo "ERROR: agent URL patch failed" && exit 1)
1916
RUN npm run build
2017

2118
FROM base AS runner

examples/integrations/pydantic-ai/docker/Dockerfile.app

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ WORKDIR /app
1212
COPY --from=deps /app/node_modules ./node_modules
1313
COPY . .
1414
RUN node -e "const fs=require('fs'); const f='next.config.ts'; let c=fs.readFileSync(f,'utf8'); if(!c.includes('ignoreBuildErrors')){c=c.replace('};',' typescript: { ignoreBuildErrors: true },\n output: \"standalone\",\n};'); fs.writeFileSync(f,c);} else if(!c.includes('standalone')){c=c.replace('};',' output: \"standalone\",\n};'); fs.writeFileSync(f,c);}"
15-
# Patch hardcoded agent URL to read from AGENT_URL env var at runtime
16-
RUN sed -i 's|url: "http://localhost:8000/"|url: process.env.AGENT_URL \|\| "http://localhost:8000/"|' src/app/api/copilotkit/route.ts
17-
RUN grep -q 'process.env.AGENT_URL' src/app/api/copilotkit/route.ts || (echo "ERROR: agent URL patch failed" && exit 1)
1815
RUN npm run build
1916

2017
FROM base AS runner

0 commit comments

Comments
 (0)