compose
Technical notes on web development, DevOps, and AI integration.
6 articles
- 17:43devops
Docker Compose Waits for a Ready Database, Not a Running One
depends_on only waits for a running container. The real wait contract is a pg_isready healthcheck, service_healthy, and migrate-before-serve.
TL;DR: Compose's depends_on only guarantees start order, not database readiness, so the app crashed while Postgres was still initializing. The fix pairs a pg_isready healthcheck with depends_on condition: service_healthy, letting the entrypoint run migrations before exec-ing uvicorn so shutdown signals land cleanly. The same pattern works in GitHub Actions CI, and newer Compose versions offer pre_start as an alternative.
#docker#compose#postgresql - 21:53devops
A 502 from Cloudflare Tunnel, caused by a compose service name
The tunnel said 502 while every container was green. Compose DNS only knows service names, and a six-line alias solved it in one step.
TL;DR: Public URL returned 502 while everything looked healthy and curl to the proxy worked fine. Ingress pointed to proxy on port 8199 but the service is actually plane-proxy, so Docker DNS had no record and cloudflared couldn't reach the origin. Adding a network alias proxy to plane-proxy fixed it, keeping the name stable for anything outside the repo.
#docker#compose#cloudflared - 21:07devops
Self-hosting Plane without a single public port
A 13-service Plane stack on a single-admin VPS: a cloudflared sidecar as the only public door, bind-mounted state, and no public host ports.
TL;DR: Running Plane on a packed VPS clashed with its default host ports 80 and 443. I kept the 13-service stack fully internal and exposed it only via a Cloudflare Tunnel sidecar aimed at the proxy, not port 8000 which is just the API. This keeps the firewall to SSH only, handles TLS at the edge, and removes public port exposure.
#self-hosting#plane#docker - 11:17devops
Restart Is Not Deploy: A Pre-Flight Gate for the API Container
A restart gate that refuses while the tree is dirty.
TL;DR: Restarting a bind-mounted container deploys whatever sits in the working tree, so a half-finished refactor went live uncommitted. The fix is a restart script that refuses to run when the served path is dirty, using git status porcelain. The guard narrows but doesn't close the race window between check and start.
#docker#compose#bash - 22:42devops
Moving to docker compose v2: a fix that was three years late
My dev script still called docker-compose in eleven places. Compose v1 has been EOL since June 2023; only a symlink kept it alive.
TL;DR: The dev script still called docker-compose, deprecated since mid-2023, and only survived thanks to a Docker Desktop compatibility symlink masking the problem. Compose v2 turned the command into a docker CLI subcommand, so it's now two words. Swapping the hyphen for a space across all call sites is a tiny commit that prevents CI breakage.
#docker#compose#devops - 22:24devops
WordPress Full vs View: Two Git Repos, Two Different Jobs
One WordPress install, two Git repos: a full Forgejo repo for recovery, a GitHub view repo carrying only source I wrote myself.
#wordpress#git#github