fix(supabase): add healthchecks to rest and functions services#79
Open
Carlos-Vera wants to merge 1 commit into
Open
fix(supabase): add healthchecks to rest and functions services#79Carlos-Vera wants to merge 1 commit into
Carlos-Vera wants to merge 1 commit into
Conversation
`rest` (PostgREST) and `functions` (edge-runtime) ship without a healthcheck at either the image or the compose level, so Docker reports them as plain `Up` with no health state and the compose service never reads as fully healthy in EasyPanel. - rest: the image is distroless, so the check uses PostgREST's own `postgrest --ready` binary against the admin server, enabled on localhost with the port left unpublished. - functions: dependency-free TCP check on :9000 using the bash that already ships in the image. The rest healthcheck is the one merged upstream in supabase/supabase#46658. Reported in easypanel-io#77. No image versions changed. Autor: Carlos Vera <carlos@braveslab.com> --- De un venezolano para el mundo con el favor de nuestro Señor JesusCristo.
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds a healthcheck to the
rest(PostgREST) andfunctions(edge-runtime) services of the Supabase template. No image versions are changed.Why
Both services ship without a healthcheck at either the image or the compose level, so Docker reports them as plain
Upwith no health state.kongandmetaalso omit a compose-level healthcheck, but their images carry one, so Docker still reports themhealthy.EasyPanel aggregates per-container health into the service status, so a container with no health state keeps the whole compose service from ever reading as healthy, even when everything works. It also weakens restart-on-unhealthy and any
depends_on: condition: service_healthygating.Reported in #77.
How
rest — the PostgREST image is distroless (no
sh/bash/curl/wget), so aCMD-SHELLcheck cannot run inside it. PostgREST v14 ships a--readyCLI flag: the binary itself queries its admin server and exits non-zero until it is live and connected to the database. This branch is already onpostgrest/postgrest:v14.8, so the flag is available.The admin server is enabled with
PGRST_ADMIN_SERVER_PORT: 3001andPGRST_ADMIN_SERVER_HOST: localhost. It serves/live,/readyand/metricswithout auth, but it is bound to localhost and the port is not published, so it is only reachable from inside therestcontainer — which is where the healthcheck runs. Residual risk only if someone rebinds the host to0.0.0.0or publishes port 3001.functions — the edge-runtime image ships bash and the runtime listens on
:9000(the port Kong proxies/functions/v1to), so a dependency-free TCP check works:Upstream
The
resthealthcheck is the same one merged intosupabase/supabasemaster in supabase/supabase#46658, from the issue I filed in supabase/supabase#46642. Thepostgrest --readyapproach came from @aantti's review there. Thefunctionscheck follows the proposal in that same issue.Tested
Running on EasyPanel from a fork of this branch for ~22 hours, project
walterhaus-web:Relation to
update.jsWorth saying plainly: this edit does not survive a template regen —
copyDirdoesrm -rf ./codeand recopiessupabase/dockerwholesale. Theresthealthcheck would come down on its own the next time the template is regenerated, since it is already in Supabase master.The point of this PR is that a regen also pulls in everything else that landed upstream since this branch was cut, which is a much bigger change to hand to existing deployments. This is the small, low-risk version of the same fix, applied now.