fix(api): package api/prompts into the Docker image

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) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 10:29:08 -05:00
parent b4d22f5c5f
commit f18d306059
2 changed files with 6 additions and 2 deletions

View File

@@ -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.

View File

@@ -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