vikrant69g blog

Preview URLs without the Kubernetes tax

A self-hosted tool that spins up Docker containers with public URLs. No orchestrator, no cloud bill.

Terminal window showing Docker containers running with generated subdomain URLs

Someone built a tool that does what Vercel does for frontends, but for any Docker container. You push a branch, it spins up a sandbox with a public preview URL. The interesting bit is what it does not use. No Kubernetes. No cloud orchestrator. Just Docker on a single server and a Go binary that routes traffic. The author wanted ephemeral dev environments without learning kubectl or paying for managed clusters. Fair trade. The routing works with a wildcard DNS record pointing at the host. Each sandbox gets a subdomain. Traefik or Caddy handle TLS. The Go process watches for new containers, registers them, tears them down when the branch closes. If you have ever set up ngrok tunnels manually for every pull request, this is the same idea but permanent. I like tools that skip the standard stack when the standard stack is overkill. Preview environments do not need auto-scaling or multi-zone failover. They need a URL that works for fifteen minutes while someone reviews your code. A single box with good routing is enough. The repo includes a GitHub Actions workflow. Push to a branch, the action builds the image, SSHs into the host, runs the container, reports the URL back as a comment. Rough but functional. You could swap GitHub Actions for any CI that can SSH somewhere. This would break at maybe fifty concurrent sandboxes on one machine. CPU limits, memory pressure, port exhaustion. But most teams do not have fifty open pull requests at once. If you do, you have already adopted Kubernetes and this post is not for you. What I would change: add a TTL so containers auto-delete after six hours. Pull requests sit open for days. Sandboxes should not.


Source: Self-hosted dev sandboxes with preview URLs (Docker, Go, no K8s)