Project case study
A public site with a private origin
Bringing Ask Habib online through Cloudflare Tunnel without publishing application ports on the VPS.
Problem
Ask Habib needed a real production path before its portfolio and future search features could grow. A browser needed to reach the site over HTTPS, while the origin’s application services stayed private. The intended route also needed to be testable: a running container alone would not prove that the public hostname reached the correct application.
This study covers the first deployment of this independent project. It does not describe an employer’s production environment.
Constraints and decision
The initial runtime is one VPS with a static Astro frontend, Caddy, and a small Go API. Keeping the deployment small makes its exposure and recovery path easier to inspect. I chose an outbound Cloudflare Tunnel connection rather than publishing the web server or API on the host.
The request path is Cloudflare → tunnel connector → Caddy → Go API for API traffic. Static pages stop at Caddy. The connector and API occupy separate private container networks, with Caddy joining both. Host administration remains separate from public application traffic.
The ingress decision records the alternatives and operational dependencies. The single-VPS decision explains the intentionally limited topology.
Implementation
Application containers publish no host ports. Caddy serves the built frontend and forwards only the API route to the Go service. The connector receives its credential as a runtime file outside the repository. Images run as non-root users with reduced capabilities and read-only filesystems where configured.
The API supplies a health response and generates a request ID for each request. Production verification can match the public response’s request ID with the origin log. The health response is not cached, so a successful public check exercises a live route rather than a stored page.
Verification
The first deployment checked the Compose definition, actual container bindings, host listeners, internal health, and public HTTPS. An external scan added a separate view of reachability. The owner also opened the page in a browser.
Local container smoke tests use Podman. Release CI builds and runs the same release on native Linux AMD64 before publishing the tested images. The checks cover static assets, API proxying, request IDs, security headers, and graceful shutdown. These checks establish several distinct properties; none alone proves every part of the route.
Tradeoffs and limits
The tunnel removes the need for an inbound application listener, but Cloudflare’s account, DNS, availability, and connector credential become dependencies. A connected connector can coexist with a broken backend, so application checks must continue beyond tunnel status.
One VPS remains a single failure domain. This deployment does not claim high availability or database recovery. It provides a concrete production baseline, with recovery and exposure rules that later features must preserve.
Related work: trusted visitor identity and the production walking skeleton.