diff --git a/api/.env.example b/api/.env.example index 0d6b52a..7dfd995 100644 --- a/api/.env.example +++ b/api/.env.example @@ -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. 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..37b241c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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