[30388f42] Infrastructure Hardening & Final Touches: Stabilized Lead Engine (Nginx routing, manager.py, Dockerfile fixes), restored known-good Nginx configs, and ensured all recent fixes are committed. System is ready for migration.

- Fixed Nginx proxy for /feedback/ and /lead/ routes.
- Restored manager.py to use persistent SQLite DB and corrected test lead triggers.
- Refined Dockerfile for lead-engine to ensure clean dependency installs.
- Applied latest API configs (.env) to lead-engine and duckdns services.
- Updated documentation (GEMINI.md, readme.md, RELOCATION.md, lead-engine/README.md) to reflect final state and lessons learned.
- Committed all pending changes to main branch.
This commit is contained in:
2026-03-07 20:01:48 +00:00
parent 592d04a32a
commit 57081bf102
10 changed files with 335 additions and 683 deletions

View File

@@ -1,31 +1,22 @@
# --- STAGE 1: Builder ---
FROM python:3.11-slim AS builder
FROM python:3.9-slim
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Ensure we have the latest pip
RUN pip install --upgrade pip
# Install python dependencies
# Copy only the requirements file first to leverage Docker cache
COPY requirements.txt .
RUN pip install --user --no-cache-dir -r requirements.txt
# --- STAGE 2: Runtime ---
FROM python:3.11-slim
WORKDIR /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy installed packages
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH
# Copy app code
# Copy the rest of the application code
COPY . .
ENV PYTHONUNBUFFERED=1
EXPOSE 8501
EXPOSE 8004
# Start monitor in background and streamlit in foreground
CMD ["sh", "-c", "python monitor.py & streamlit run app.py --server.port=8501 --server.address=0.0.0.0 --server.baseUrlPath=/lead"]
# Start monitor, feedback server, and streamlit
CMD ["sh", "-c", "python monitor.py & uvicorn trading_twins.manager:app --host 0.0.0.0 --port 8004 --reload --log-level debug & streamlit run app.py --server.port=8501 --server.address=0.0.0.0"]