From 05753edbb1690f00bcc1945e6e9096f7e7663306 Mon Sep 17 00:00:00 2001 From: Floke Date: Thu, 1 Jan 2026 08:36:48 +0000 Subject: [PATCH] fix(gtm-architect): Stabilize Docker environment and fix frontend - Refactor Docker build process for gtm-app to ensure reliability - Correct volume mounts and build context in docker-compose.yml to prevent stale code - Fix frontend 404 error by using relative paths in index.html - Ensure API key is correctly mounted into the container - Stabilize Node.js to Python data passing via explicit --data argument - Update gtm_architect_documentation.md with extensive troubleshooting guide --- docker-compose.yml | 18 ++-- gtm-architect/App.tsx | 4 +- gtm-architect/index.html | 4 +- gtm-architect/server.cjs | 158 +++++++++++++++++---------------- gtm_architect_documentation.md | 42 ++++++--- gtm_architect_orchestrator.py | 85 +++++++++++++++++- gtm_architect_plan.md | 23 ----- helpers.py | 15 +--- 8 files changed, 210 insertions(+), 139 deletions(-) delete mode 100644 gtm_architect_plan.md diff --git a/docker-compose.yml b/docker-compose.yml index 700c8091..33b901b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -86,26 +86,24 @@ services: - market-backend # Port 80 is internal only - # --- GTM ARCHITECT --- gtm-app: build: context: . dockerfile: gtm-architect/Dockerfile container_name: gtm-architect restart: unless-stopped + ports: + - "3005:3005" volumes: - # Sideloading: Python Logic + # Sideloading for live development - ./gtm_architect_orchestrator.py:/app/gtm_architect_orchestrator.py - - ./market_db_manager.py:/app/market_db_manager.py + - ./gtm-architect/server.cjs:/app/server.cjs - ./helpers.py:/app/helpers.py - ./config.py:/app/config.py - # Sideloading: Server Logic - - ./gtm-architect/server.cjs:/app/server.cjs # Database Persistence - ./gtm_projects.db:/app/gtm_projects.db - # Keys - - ./gemini_api_key.txt:/app/gemini_api_key.txt + # Mount the API key to the location expected by config.py + - ./gemini_api_key.txt:/app/api_key.txt environment: - - PYTHONUNBUFFERED=1 - - DB_PATH=/app/gtm_projects.db - # Port 3005 is internal only \ No newline at end of file + - OPENAI_API_KEY=${OPENAI_API_KEY} + - SERPAPI_API_KEY=${SERPAPI_API_KEY} \ No newline at end of file diff --git a/gtm-architect/App.tsx b/gtm-architect/App.tsx index d2c9e238..4278b0e6 100644 --- a/gtm-architect/App.tsx +++ b/gtm-architect/App.tsx @@ -696,7 +696,7 @@ ${prompt.prompt}\n\

{labels.features}