Fix build version showing "unknown" in production
The previous approach baked git rev-parse --short HEAD into the image at Docker build time, but Dockhand's build context doesn't reliably have .git available, so it silently fell back to "unknown" in production even though the build itself succeeded. Replace it with a plain VERSION file committed to the repo (a timestamp + short description, updated by hand alongside each commit) that ships via the same COPY . . as everything else - no git access needed inside the build at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,13 +44,16 @@ triggers a full image **rebuild** from the Dockerfile (confirmed, not just a
|
||||
container restart), so Dockerfile changes (e.g. adding `ffmpeg`) take effect
|
||||
on the very next push without any manual step.
|
||||
|
||||
**Confirming a deploy landed:** the Dockerfile bakes the exact commit and
|
||||
build time into the image as `/app/BUILD_VERSION` (`git rev-parse` at build
|
||||
time, `.git` itself is deleted again right after so it doesn't ship in the
|
||||
image) - shown at the bottom of the Settings page and in `/health`'s JSON
|
||||
response, so after a push you can check the running container actually
|
||||
picked it up instead of guessing. Reads as `dev` outside Docker (no
|
||||
`BUILD_VERSION` file to read).
|
||||
**Confirming a deploy landed:** a plain `VERSION` file at the repo root
|
||||
(a timestamp + short description, updated by hand alongside each commit)
|
||||
ships into the image via the normal `COPY . .` and is shown at the bottom
|
||||
of the Settings page and in `/health`'s JSON response, so after a push you
|
||||
can check the running container actually picked it up instead of
|
||||
guessing. Deliberately not derived from `git rev-parse` at Docker build
|
||||
time - Dockhand's build context doesn't reliably have `.git` available,
|
||||
which silently produced "unknown" instead of an actual commit. Reads as
|
||||
`dev` outside Docker (no `VERSION` file to read, e.g. before the first
|
||||
commit that adds one).
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user