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:
parent
6eada58629
commit
20872b2383
2 changed files with 7 additions and 6 deletions
|
|
@ -7,9 +7,10 @@ services:
|
||||||
apply:
|
apply:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
environment:
|
environment:
|
||||||
# Coolify injects SOURCE_COMMIT at runtime on every deploy; settings.py
|
# SOURCE_COMMIT is auto-injected by Coolify at runtime; settings.py
|
||||||
# reads GIT_COMMIT and renders it in the footer.
|
# reads it and renders it in the footer. Don't reference it here —
|
||||||
- GIT_COMMIT=${SOURCE_COMMIT:-dev}
|
# Coolify treats any ${SOURCE_COMMIT} in the compose as a user env
|
||||||
|
# var and stops injecting the real SHA.
|
||||||
- AUTH_USERNAME=${AUTH_USERNAME}
|
- AUTH_USERNAME=${AUTH_USERNAME}
|
||||||
- AUTH_PASSWORD_HASH=${AUTH_PASSWORD_HASH}
|
- AUTH_PASSWORD_HASH=${AUTH_PASSWORD_HASH}
|
||||||
- SESSION_SECRET=${SESSION_SECRET}
|
- SESSION_SECRET=${SESSION_SECRET}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,6 @@ ANTHROPIC_MODEL: str = getenv("ANTHROPIC_MODEL", "claude-haiku-4-5-20251001")
|
||||||
|
|
||||||
# --- Build info --------------------------------------------------------------
|
# --- Build info --------------------------------------------------------------
|
||||||
# Coolify injects SOURCE_COMMIT into the container's runtime env on every
|
# 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
|
# deploy. GIT_COMMIT is the local-dev override. Rendered in the footer so
|
||||||
# footer so the running commit is visible at a glance.
|
# the running commit is visible at a glance.
|
||||||
GIT_COMMIT: str = getenv("GIT_COMMIT", "").strip() or "dev"
|
GIT_COMMIT: str = (getenv("GIT_COMMIT") or getenv("SOURCE_COMMIT") or "").strip() or "dev"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue