mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
feat(docker): add a HEALTHCHECK to the image (#1394)
Report Docker application health using a bounded loopback HTTP probe. Contribution by @14traits.
This commit is contained in:
3 files changed
+16
No files matched your search
@@ -39,6 +39,11 @@ COPY --chown=node:node . .
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=4173
|
||||
EXPOSE 4173
|
||||
# node:slim has no curl, so probe with Node's built-in fetch. 127.0.0.1 is
|
||||
# always on the Host allowlist, and the generous start period covers Vite's
|
||||
# first-run dependency optimisation.
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
||||
CMD ["node", "-e", "fetch('http://127.0.0.1:'+(Number.parseInt(process.env.PORT,10)||4173)+'/').then((r)=>process.exit(r.ok?0:1),()=>process.exit(1))"]
|
||||
# The launcher is `npm run dev` plus one step: it trusts the container's
|
||||
# gateway address for Provider Settings, because that is where Docker delivers
|
||||
# the host's own browser from (never 127.0.0.1). See scripts/docker-start.mjs.
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
- Report Docker container health with a local HTTP check using Node, with the
|
||||
same port parsing as the launcher (John Rogers, @14traits, #1394).
|
||||
@@ -6228,3 +6228,12 @@ when their footprints touch or contain one another, never across a seam toleranc
|
||||
- `scripts/qa-form-fields.mjs` exercises native selections, number validity,
|
||||
calibration commit/cancel and stale-camera/disposal guards against an installed
|
||||
controller with fixture ports, plus default/Cyber and narrow translated layouts.
|
||||
|
||||
## Docker health reporting
|
||||
|
||||
The Docker image probes its local HTTP root with Node every 30 seconds, using
|
||||
the launcher's parsed `PORT` (default 4173). A successful HTTP response marks
|
||||
the container healthy. Checks time out after 10 seconds, with a 30-second
|
||||
startup grace period and three consecutive failures before reporting unhealthy.
|
||||
This reports app HTTP availability, not individual provider health, and does not
|
||||
configure automatic restarts.
|
||||
Reference in new issue
Block a user