forked from molecule-ai/molecule-core
fix(compose): platform build context must be repo root, not ./platform
The platform Dockerfile COPYs paths relative to the repo root — \`COPY platform/go.mod\`, \`COPY platform/migrations\`, \`COPY workspace-configs-templates\`. The compose file was setting \`context: ./platform\`, which silently caused those COPY layers to miss + stop invalidating cache. Symptom (caught 2026-04-16 10:22 UTC): after PR #417 (memory schema migration 023) merged + I ran \`docker compose up -d --build platform\`, the rebuild was a no-op. Image SHA didn't change, container booted with old migration set, \`Applied 22 migrations\` instead of the expected 23. Migration 023 file was on disk locally but never reached the image. Workaround was \`docker build -t molecule-monorepo-platform:fresh -f platform/Dockerfile .\` from repo root → SHA changed, migration 023 applied. This commit makes \`docker compose up -d --build platform\` work correctly without the manual workaround. CI workflow already builds with \`context: .\` + \`file: ./platform/Dockerfile\` (per the comment at the top of platform/Dockerfile). This change just aligns the local compose file with what CI does. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
18837c44ca
commit
239e211d3d
@ -102,8 +102,17 @@ services:
|
||||
# --- Platform ---
|
||||
platform:
|
||||
build:
|
||||
context: ./platform
|
||||
dockerfile: Dockerfile
|
||||
# Build context MUST be repo root, not ./platform — the Dockerfile
|
||||
# COPYs `platform/migrations`, `platform/go.mod`,
|
||||
# `workspace-configs-templates/` etc. via repo-relative paths so it
|
||||
# can bake in templates + migrations alongside the platform binary.
|
||||
# When context was ./platform earlier, docker silently cached an
|
||||
# earlier image (the COPY platform/migrations resolved to nothing
|
||||
# under ./platform/, so layers stopped invalidating) — manifested
|
||||
# as migration 023 not landing after PR #417 merged. CI workflow
|
||||
# already uses context=. , this aligns local with CI.
|
||||
context: .
|
||||
dockerfile: platform/Dockerfile
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
Loading…
Reference in New Issue
Block a user