compose: declare ollama_data as external to silence adoption warning
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 <name>` first (or set
OLLAMA_DATA_VOLUME to a name you've already created).
This commit is contained in:
@@ -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
|
||||
# <name>` if you ever deploy fresh and the foreign one isn't there).
|
||||
ollama_data:
|
||||
external: true
|
||||
name: ${OLLAMA_DATA_VOLUME:-neuro-gateway_ollama_data}
|
||||
|
||||
Reference in New Issue
Block a user