-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.demo-console
More file actions
59 lines (55 loc) · 3.15 KB
/
Copy pathDockerfile.demo-console
File metadata and controls
59 lines (55 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Demo-console container image (Phase 1-C).
#
# Replaces the Phase 1-B host-process (serve.py on Windows) with a real
# container on the internal-only network. This is the ONLY service allowed
# to publish a port — bound to 127.0.0.1:8600 (loopback only).
#
# Build context: repository root (see docker-compose.yml).
# Base image: python:3.12-slim — CACHED in the MergePilot-Test daemon.
# pip install at BUILD time only; NOT executed in Phase 1-C (needs separate
# dependency-install authorization).
FROM python:3.12-slim
RUN pip install --no-cache-dir psycopg2-binary==2.9.12
COPY tools/demo_console/serve.py /app/serve.py
COPY tools/demo_console/preflight.py /app/preflight.py
COPY tools/demo_console/postgres_source.py /app/postgres_source.py
COPY tools/demo_console/live_poller.py /app/live_poller.py
# 1-G stabilization sweep: serve.py imports live_refresh at startup (the
# fail-closed JS contract validator). The Phase 1-E module was missing from
# this COPY list; the real retry-5 run crashed with ModuleNotFoundError:
# No module named 'live_refresh'.
COPY tools/demo_console/live_refresh.py /app/live_refresh.py
COPY tools/demo_console/integrity.py /app/integrity.py
COPY tools/demo_console/schema.py /app/schema.py
COPY tools/demo_console/one_click_startup.py /app/one_click_startup.py
COPY tools/demo_console/mergepilot_integration.py /app/mergepilot_integration.py
COPY tools/demo_console/evidence_manifest.py /app/evidence_manifest.py
COPY tools/demo_console_entrypoint.py /app/demo_console_entrypoint.py
# Review-gap Fix 3: in-container readiness probe (loopback-only HTTP against
# /api/live/status; healthy requires 200 + valid JSON + POSTGRES_ISOLATED +
# source_read_only + an available startup snapshot).
COPY tools/demo_console/console_healthcheck.py /app/console_healthcheck.py
# Retry v3 Fix 2 + Phase 1-E protected-path fix: the dynamic console lives
# in tools/demo_console/live_assets (NON-protected path — samples/ is in
# evidence_manifest.PROTECTED_PATH_PREFIXES and stays REPLAY-frozen). It is
# shipped to the FIXED allowlisted container path /app/live-console that
# the entrypoint passes as --serve-dir. Nothing is copied from samples/.
COPY tools/demo_console/live_assets /app/live-console
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
MERGEPILOT_PG_HOST=postgres \
MERGEPILOT_PG_PORT=5432 \
MERGEPILOT_PG_DATABASE=mergepilot_audit
# The reader DSN is taken from MERGEPILOT_PG_DSN (env) — never from argv.
# The entrypoint validates from the environment and refuses to run in REPLAY
# mode: MERGEPILOT_MODE / MERGEPILOT_SOURCE_KIND / MERGEPILOT_RUN_ID /
# MERGEPILOT_EXPECTED_ROLE / MERGEPILOT_BIND_CONTEXT (host|container;
# 0.0.0.0 allowed ONLY in container mode) / MERGEPILOT_HOST /
# MERGEPILOT_PORT, plus the five PostgreSQL expected identity params
# (MERGEPILOT_PG_EXPECTED_DATABASE, MERGEPILOT_PG_ENVIRONMENT_ID,
# MERGEPILOT_PG_EXPECTED_SERVER_ADDRESSES — the MEASURED bridge IP, never
# hardcoded —, MERGEPILOT_PG_EXPECTED_SERVER_PORT,
# MERGEPILOT_PG_EXPECTED_APPLICATION_NAME). None of them get image-level
# defaults: a missing value is a CONFIG_INVALID failure, not a fallback.
EXPOSE 8600
ENTRYPOINT ["python", "-u", "/app/demo_console_entrypoint.py"]