- Implement a central reverse proxy (Nginx) with Basic Auth on port 8090. - Create a unified landing page (dashboard) to access B2B Assistant and Market Intelligence. - Update frontends with relative API paths and base paths for subdirectory routing (/b2b/, /market/). - Optimize Docker builds with .dockerignore and a Python-based image for market-backend. - Enable code sideloading for Python logic via Docker volumes. - Fix TypeScript errors in general-market-intelligence regarding ImportMeta.
55 lines
1.6 KiB
Docker
55 lines
1.6 KiB
Docker
# Stage 1: Build the React frontend
|
|
FROM node:20-slim AS frontend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package.json and install all dependencies
|
|
# Paths are relative to the build context (project root)
|
|
COPY b2b-marketing-assistant/package.json ./
|
|
RUN npm install
|
|
|
|
# Copy the rest of the frontend application code
|
|
COPY b2b-marketing-assistant/ .
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# ---
|
|
|
|
# Stage 2: Final application image
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies (minimal)
|
|
# We use NodeSource to get a clean, modern Node.js install without bloat
|
|
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 Python dependencies
|
|
COPY b2b-marketing-assistant/requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the Node.js server and its production dependencies manifest
|
|
COPY b2b-marketing-assistant/server.cjs .
|
|
COPY b2b-marketing-assistant/package.json .
|
|
|
|
# Install only production dependencies for the Node.js server
|
|
RUN npm install --omit=dev
|
|
|
|
# Copy the built React app from the builder stage
|
|
COPY --from=frontend-builder /app/dist ./dist
|
|
|
|
# Copy the main Python orchestrator script from the project root
|
|
COPY b2b_marketing_orchestrator.py .
|
|
# Copy Gemini API Key file if it exists in root
|
|
COPY gemini_api_key.txt .
|
|
|
|
# Expose the port the Node.js server will run on
|
|
EXPOSE 3002
|
|
|
|
# The command to run the application
|
|
CMD ["node", "server.cjs"] |