Merge fix/docker-prompts-packaging into dev
Package api/prompts into the Docker image and give the Dockerized proxy a route to a host-run Ollama. M1's narrator pipeline was proven via venv-on- host; these were the two Docker-path gaps the client HTTP loop surfaced.
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
# any of these — keys live only in the proxy (charter §4).
|
||||
|
||||
# Where the proxy sends model calls in dev (Ollama on the homelab).
|
||||
# Running the proxy IN DOCKER with Ollama on THIS host? localhost points at the
|
||||
# container, not the host — use http://host.docker.internal:11434 instead
|
||||
# (docker-compose.yml maps that name via host-gateway). Bare-metal/venv: keep
|
||||
# localhost. Homelab Ollama: use its address.
|
||||
OLLAMA_BASE_URL=http://localhost:11434
|
||||
|
||||
# Prod model provider (charter §4). Leave blank in dev.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -14,9 +14,17 @@ services:
|
||||
required: false
|
||||
environment:
|
||||
PORT: 8000
|
||||
# Mount source + schemas so edits are live without a rebuild.
|
||||
# Reach a host-run Ollama from inside the container. On Linux, localhost in
|
||||
# the container is the container itself, so OLLAMA_BASE_URL must be
|
||||
# http://host.docker.internal:11434 (set in api/.env); this maps that name
|
||||
# to the Docker host. Harmless when Ollama is on the homelab instead.
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user