Project: Demo Garden
What is it?
- On-demand container lifecycle management via a custom Go lazy loader
- Nginx reverse proxy routing traffic to the right container per subdomain
- CI/CD via GitHub Actions — push to deploy in under 1 minute
- Supports any stack that can be containerized: Python, Go, Deno, static sites, databases
- Sub-services (workers, DBs) are also managed and cleaned up automatically
The Demo Garden dashboard
Backstory
The idea started from wanting a single, owned place to host technical experiments — without scattering them across Vercel, Fly.io, Heroku, and GCP trial accounts that eventually expire. The goal was a system that was stateless enough to rebuild quickly if something went wrong, and cheap enough to run indefinitely.
The result runs on an AWS EC2-micro instance (1GB RAM, slow CPU) and hosts dozens of demos. When no traffic arrives, nginx and the lazy loader together use around 10MB of RAM. When a request comes in for a sleeping container, the lazy loader wakes it, proxies the request, then watches for idle time before putting it back to sleep — closely mirroring how platforms like Cloud Run and Heroku manage scale-to-zero internally.
The lazy loader was initially written in Python (~50MB memory footprint) and later rewritten in Go to get it down to near-zero overhead. It was a good excuse to learn Go properly.
CI/CD runs on GitHub Actions: images are pre-built on the runner (not on the tiny VM), cached aggressively, then copied to the server and started via SSH. The full deploy cycle — push to live — takes under a minute.
Each demo gets a page with a description sidebar and an embedded live preview. The project is open source: github.com/pnettto/demo-garden.
Technical details
Infrastructure
- AWS EC2-micro (1GB RAM) — single VM hosting all services
- Nginx reverse proxy — subdomain-based routing to containers
- Custom Go lazy loader — wake/sleep logic with dependency cascade cleanup
- Docker + Docker Compose — all services containerized
- GitHub Actions CI/CD — image pre-build, caching, SSH deploy
Stack
- Go (lazy loader)
- Nginx
- Docker / Docker Compose
- GitHub Actions
- AWS EC2