From 2af4c9f835c5df1c886c366fdf92733ad7c494d0 Mon Sep 17 00:00:00 2001 From: jpwilson Date: Tue, 24 Feb 2026 20:08:04 -0600 Subject: [PATCH] fix(agent): include chat UI HTML in production build Copy agent-chat.html to dist output in Dockerfile.railway and add fallback path lookup in controller for production deployments. --- Dockerfile.railway | 3 +++ apps/api/src/app/agent/agent.controller.ts | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile.railway b/Dockerfile.railway index 980c78c0d..94bb13502 100644 --- a/Dockerfile.railway +++ b/Dockerfile.railway @@ -39,6 +39,9 @@ COPY prisma /ghostfolio/dist/apps/api/prisma/ COPY package.json /ghostfolio/dist/apps/api/ RUN npm run database:generate-typings +# Copy agent chat HTML to dist +RUN cp /ghostfolio/apps/api/src/app/agent/agent-chat.html /ghostfolio/dist/apps/api/ 2>/dev/null || true + # Runtime image FROM node:22-slim ENV NODE_ENV=production diff --git a/apps/api/src/app/agent/agent.controller.ts b/apps/api/src/app/agent/agent.controller.ts index e8d8b45bc..914952638 100644 --- a/apps/api/src/app/agent/agent.controller.ts +++ b/apps/api/src/app/agent/agent.controller.ts @@ -40,7 +40,7 @@ export class AgentController { const fs = require('node:fs'); const path = require('node:path'); - // Try source path first (dev), then dist path + // Try source path first (dev), then dist paths const paths = [ path.join( process.cwd(), @@ -51,7 +51,8 @@ export class AgentController { 'agent', 'agent-chat.html' ), - path.join(__dirname, 'agent-chat.html') + path.join(__dirname, 'agent-chat.html'), + path.join(process.cwd(), 'agent-chat.html') ]; for (const p of paths) {