fix(web): read SOURCE_COMMIT directly, don't reference it in compose

Previous attempt mapped GIT_COMMIT=${SOURCE_COMMIT:-dev} in compose.
That backfired: Coolify parses the compose, sees ${SOURCE_COMMIT},
auto-registers it as a user-defined env var with my "dev" default,
and then *skips* its own SHA injection — because the registration
guard is "only inject if user hasn't defined it." Result: container
got SOURCE_COMMIT=dev and footer kept showing build dev.

Drop the compose reference entirely so Coolify's auto-injection
takes over, and read SOURCE_COMMIT in settings.py (with GIT_COMMIT
kept as the local-dev override). One-time cleanup of the orphan
SOURCE_COMMIT rows in the Coolify DB was done out-of-band.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
EiSiMo 2026-04-23 11:16:19 +02:00
parent 6eada58629
commit 20872b2383
2 changed files with 7 additions and 6 deletions

View file

@ -62,6 +62,6 @@ ANTHROPIC_MODEL: str = getenv("ANTHROPIC_MODEL", "claude-haiku-4-5-20251001")
# --- Build info --------------------------------------------------------------
# Coolify injects SOURCE_COMMIT into the container's runtime env on every
# deploy; docker-compose.yml maps it to GIT_COMMIT. Rendered in the site
# footer so the running commit is visible at a glance.
GIT_COMMIT: str = getenv("GIT_COMMIT", "").strip() or "dev"
# deploy. GIT_COMMIT is the local-dev override. Rendered in the footer so
# the running commit is visible at a glance.
GIT_COMMIT: str = (getenv("GIT_COMMIT") or getenv("SOURCE_COMMIT") or "").strip() or "dev"