Repository navigation
dev2: lean Supabase stacks (drop studio, meta, imgproxy, supavisor) - #115
Merged
Merged
Conversation
dev2 is at 91 GB with swap full, and each of the 21 per-site Supabase stacks runs four services no app uses: studio (~155 MiB), postgres-meta (~70), supavisor (~80) and imgproxy (~16), about 6.7 GB in all. Measured on 2026-10-01: no /pg/ or /storage/v1/render/ requests in any gateway log, no image transforms in any app repo, no client connections to a pooler (loopback-only ports, nothing references them; bittorrented's droplet tunnels to the db port). - supabase-stack.sh: optional services are dropped by default (DROP_SERVICES); a dropped service is `!reset null` in the overlay, and api-gw's depends_on studio / storage's depends_on imgproxy are rewritten as one-line "# lean:" entries. depends_on is not part of compose's config hash, so no remaining container is recreated. storage's image-transform env is left alone on purpose (changing it would recreate storage). - MODE=services: apply the service set to a running stack by editing its LIVE overlay (the stacks predate later template additions, so re-rendering would recreate storage/functions). Gate: every remaining service's new config hash must equal its running container's label; db is never recreated; other drift needs ALLOW_RECREATE. Backs up .env and the overlay as <name>.bak-NNN.<ext>, then `up -d --remove-orphans --pull never`. - dev2-site supabase-services <site> [--dry-run] [--allow-recreate SVC..]; sites.d "keep_services": ["imgproxy", ...] opts a stack back in. Dry run on all 21 stacks: 7 services kept unchanged (db included), 4 removed. Gateway ports, keys, container names and networks are unchanged, so no app env, vhost or deploy-dev2 workflow is affected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan25 finding(s) HIGH/CRITICAL: 4 | MEDIUM: 12 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
This was referenced Oct 1, 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.
dev2 (production, 91 GB) has swap ~100% used. Each of the 21 per-site Supabase stacks runs four services that no app uses: studio, postgres-meta, supavisor and imgproxy, about 300 MiB per stack and ~6.7 GB in total.
Evidence they are unused (2026-10-01, read-only on dev2):
/pg/(meta): 0 requests in any gateway log. Studio: the only hits were one scanner fetching/css/support_parent.css(401)./storage/v1/render/(imgproxy): 0 hits. Notransform/render/imagecalls in any of the 21 app repos.127.0.0.1only. No established connections to 66xx, and no inbound sockets in any supavisor container. Noapp.env/deploy.env/compose file on the box mentions a pooler. bittorrented's droplet tunnels to the db port (5590).What changes
templates/supabase-stack.sh: optional services are dropped by default viaDROP_SERVICES. A dropped service becomes!reset nullin the overlay. Thedepends_onentries that pointed at the removed services (api-gw on studio, storage on imgproxy) are rewritten as one-line# lean:entries. Compose leavesdepends_onout of its config hash, so no remaining container is recreated.MODE=servicesedits each stack's live overlay instead of re-rendering it. The stacks predate later template additions (FILE_SIZE_LIMIT, functionsenv_file), so a re-render would recreate storage and functions. Before anything is applied, every remaining service's new hash must equal its running container's label. db is never recreated, and drift in any other service is refused unless--allow-recreateis given..envand the overlay are backed up as<name>.bak-NNN.<ext>, thenup -d --remove-orphans --pull neverruns.dev2-site supabase-services <site> [--dry-run]. A site opts back in with sites.d"keep_services": ["imgproxy", ...].Gateway ports, keys, JWT secret, container names and networks are unchanged. So no
app.env, nginx vhost, app image ordeploy-dev2.ymlworkflow is affected.Tested
bash -nandpy_compile.--dry-runon all 21 stacks:keep=7(db included),remove=imgproxy,meta,studio,supavisor, nothing recreated.🤖 Generated with Claude Code