Refactor GTM Architect to v2: Python-driven architecture, 9-phase process, new DB and Docker setup

This commit is contained in:
2026-01-02 19:00:05 +00:00
parent a3dc012da8
commit b47a65eb83
300 changed files with 68128 additions and 4782 deletions

View File

@@ -1,63 +1,40 @@
# Stage 1: Build the React frontend
FROM node:20-slim AS frontend-builder
FROM node:18-slim AS builder
WORKDIR /app
# Copy package.json and install dependencies
# We are inside the build context root, so path is gtm-architect/package.json
COPY gtm-architect/package.json ./
RUN npm install
# Copy the source code
COPY gtm-architect/ .
# Build the application
COPY package.json ./
# Use --force to avoid issues with dependency versions
RUN npm install --force
COPY . .
RUN npm run build
# ---
# Stage 2: Final application image
FROM python:3.11-slim
# Stage 2: Setup the production environment
FROM python:3.9-slim
WORKDIR /app
# Install Node.js (minimal runtime)
RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
rm -rf /var/lib/apt/lists/*
# Install Node.js
RUN apt-get update && apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs
# Install Python dependencies
# We use the requirements from the subdirectory
COPY gtm-architect/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy built frontend from builder stage
COPY --from=builder /app/dist ./gtm-architect/dist
# Google Generative AI Library installieren
RUN pip install --no-cache-dir google-generativeai
# Copy the Node.js server script and package.json for runtime deps
COPY gtm-architect/server.cjs .
COPY gtm-architect/package.json .
# Install only production Node.js dependencies
RUN npm install --omit=dev
# Copy the built frontend from the builder stage
COPY --from=frontend-builder /app/dist ./dist
# Copy the Python Orchestrator and shared modules
# Copy backend files and application code
COPY gtm-architect/server.cjs ./gtm-architect/
COPY gtm-architect/package.json ./gtm-architect/
COPY gtm_architect_orchestrator.py .
COPY gtm_prompts.json .
COPY helpers.py .
COPY config.py .
COPY market_db_manager.py .
COPY gtm-architect/requirements.txt .
COPY gtm_db_manager.py .
# Copy API Key if available (handled by docker-compose usually, but good for standalone)
# COPY gemini_api_key.txt .
# Expose port
# Install Python and Node.js dependencies
RUN pip install --no-cache-dir -r requirements.txt
RUN cd gtm-architect && npm install --production
# Expose the port the server will run on
EXPOSE 3005
# Start the server
CMD ["node", "server.cjs"]
# Command to run the server
CMD ["node", "gtm-architect/server.cjs"]