From b8a0692aa1aaf577cbf77e6965000065b003a1df Mon Sep 17 00:00:00 2001 From: Stephan Berbig Date: Wed, 27 May 2026 22:34:45 +0200 Subject: [PATCH] compose: declare ollama_data as external to silence adoption warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every `docker compose up` was printing: WARN volume "neuro-api_neuro-ollama-data" already exists but was created for project "neuro-api" (expected "neuro-gateway"). Use `external: true` to use an existing volume That's exactly the situation we're in by design: the ollama volume is owned by a NEIGHBORING compose stack (neuro-api or neuro-ollama, depending on the host) and our gateway intentionally adopts it. The warning fires because compose was managing the volume under our project namespace even though the on-disk volume belongs to a different one. Declaring `external: true` on `ollama_data` (and only that volume — `postgres_data` stays compose-managed, since it belongs to this stack) tells compose: "this volume is foreign, just attach it as-is, don't namespace-check it." Warning gone, behavior identical. Trade-off documented in the comment: `external: true` requires the volume to exist before `up`. For fresh deployments where no foreign Ollama volume exists, run `docker volume create ` first (or set OLLAMA_DATA_VOLUME to a name you've already created). --- docker-compose.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 9c2f70a..0b1bfb5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -136,7 +136,14 @@ volumes: # Override via .env if your existing volumes are named differently: # POSTGRES_DATA_VOLUME=neuro-api_postgres-data # OLLAMA_DATA_VOLUME=neuro-ollama_ollama-data + # postgres_data is owned by THIS stack — created on first up, no external flag. postgres_data: name: ${POSTGRES_DATA_VOLUME:-neuro-gateway_postgres_data} + # ollama_data is intentionally ADOPTED from another stack (e.g. neuro-api / + # neuro-ollama). external: true tells compose "yes, that volume belongs to a + # different project — use it as-is". This silences the project-namespace + # warning. The volume MUST already exist (create with `docker volume create + # ` if you ever deploy fresh and the foreign one isn't there). ollama_data: + external: true name: ${OLLAMA_DATA_VOLUME:-neuro-gateway_ollama_data}