Skip to content

deploy: make the build context overridable for Compose Manager - #2

Open
pequalsnp wants to merge 1 commit into
mainfrom
fix-compose-manager-context
Open

deploy: make the build context overridable for Compose Manager#2
pequalsnp wants to merge 1 commit into
mainfrom
fix-compose-manager-context

Conversation

@pequalsnp

Copy link
Copy Markdown
Contributor

deploy/README.md documents an Unraid deployment, but the stack can't actually be deployed that way.

Compose Manager doesn't run a stack from a checkout — it requires the compose file to live in its own projects/<name>/docker-compose.yml. The relative context: .. then resolves to the projects directory instead of the repo root, so docker compose up -d fails to build, and the error gives no hint that the build context is the problem.

How this surfaced

On a box where refrain was already running. The image existed from an earlier build, so nothing looked wrong — right up until that image cache was about to be wiped for unrelated maintenance, at which point the stack simply would not have come back. Caught during pre-flight rather than during the outage.

The change

context: ${REFRAIN_SRC:-..}
  • Unset (the documented flow, docker compose up -d --build from deploy/) → resolves to the repo root exactly as before. Verified with docker compose config.
  • Set → points at the real checkout, so a copied compose file builds correctly.

Same pattern the subkb stack already uses for its own build context, so it should read as familiar rather than novel.

Plus: the Unraid note in deploy/README.md gets promoted to its own section with the caveat spelled out (including why the checkout shouldn't live in the compose project dir — Unraid's flash is FAT), and REFRAIN_SRC is documented in .env.example as the opt-in it is.

No Go code touched.

deploy/README.md documents an Unraid deployment, but the stack cannot
actually be deployed that way. Compose Manager does not run a stack from a
checkout — it requires the compose file to live in its own
projects/<name>/docker-compose.yml. The relative `context: ..` then
resolves to the projects directory rather than the repo root, so
`docker compose up -d` fails to build, and the failure gives no clue that
the build context is the problem.
Found the hard way on a box where refrain was already running: the image
existed from an earlier build, so nothing looked wrong until the image
cache was about to be wiped, at which point the stack would simply not
have come back.
`context: ${REFRAIN_SRC:-..}` keeps the documented `docker compose up -d
--build` from deploy/ working exactly as before — verified with
`docker compose config`, which still resolves the context to the repo
root when REFRAIN_SRC is unset — while letting a copied compose file
point at the real checkout. Same pattern the subkb stack already uses.
Also promotes the Unraid note in deploy/README.md to its own section with
the caveat spelled out, and documents REFRAIN_SRC in .env.example as the
opt-in it is.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@pequalsnp