From f18d3060598c371d3dfd636fcd488d8d37c61e17 Mon Sep 17 00:00:00 2001 From: Phillip Tarrant Date: Fri, 10 Jul 2026 10:29:08 -0500 Subject: [PATCH] fix(api): package api/prompts into the Docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The narrator pipeline (M1) reads role prompts from /app/prompts, but the Dockerfile copied only api/app and docs/schemas — never api/prompts — so /dm/narrate 500'd with FileNotFoundError on narrator.md in any Docker run. The M1 live smoke passed only because it ran uvicorn from the local venv, where ../prompts resolves on the host; the container path was never exercised until the client HTTP loop drove a real request through compose. Dockerfile now COPYs api/prompts; compose mounts it :ro so prompt edits reload live like the app code (prompts are source code, §16). Verified by building the image and confirming /app/prompts/narrator.md is present. Co-Authored-By: Claude Opus 4.8 (1M context) --- api/Dockerfile | 4 +++- docker-compose.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index f9c575b..3be8795 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -12,8 +12,10 @@ WORKDIR /app COPY api/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -# App code + the schema contract (single source of truth in docs/schemas). +# App code, the role prompts (§16 — prompts are source code), and the schema +# contract (single source of truth in docs/schemas). COPY api/app ./app +COPY api/prompts ./prompts COPY docs/schemas ./schemas # Run as non-root. diff --git a/docker-compose.yml b/docker-compose.yml index 56d63d7..51e913b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,9 +14,11 @@ services: required: false environment: PORT: 8000 - # Mount source + schemas so edits are live without a rebuild. + # Mount source + prompts + schemas so edits are live without a rebuild. + # Prompts are source code (§16) — editing a prompt should reload like code. volumes: - ./api/app:/app/app:ro + - ./api/prompts:/app/prompts:ro - ./docs/schemas:/app/schemas:ro command: > uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload