The pilot stack for hrmydeck, the HRMS built end to end with AI agents, is three pieces. None of them is a rented server.
A desktop PC runs Docker Compose: Postgres 16 plus a Laravel container serving
/admin, /employee and /api. A Cloudflare Tunnel dials out from that machine,
so there are no open ports and no public IP. DNS at Hostinger points
hr.ariefrse.my at the tunnel, and Cloudflare terminates TLS.
The container boots self-sufficient. Migrations run on start, the first boot
seeds demo accounts, and secrets live in one .env.staging file. The machine
runs unattended: cloudflared is installed as a Windows service that restarts if
it dies, containers carry restart: unless-stopped, and a scheduled task dumps
the database nightly to a second location.
The footguns
Do not run cloudflared inside Docker pointing at localhost. That is the
container's localhost, not the host's, and every request 502s. The tunnel runs
natively on the host. The app runs in Docker. They are not neighbours.
The app must know its public URL. Laravel scopes session cookies to
STAGING_PUBLIC_URL. If that does not match the browser's URL exactly, logins
die with "Page expired" and nothing anywhere hints at why.
Quick tunnels are for demos only. trycloudflare.com URLs change on every
restart. A named tunnel plus the DNS record is what makes the address permanent.
The trade-off, honestly
| What this buys | What this costs |
|---|---|
| RM0 per month, no certificates to renew | Uptime rides on one machine and one connection |
| A hidden origin that never opens a port | Failures are silent, nothing pages me |
| Real hardware, which beats a cheap VPS | Backups are nobody's problem but mine |
| A clean exit to a VPS later | Cloudflare sees the plaintext |
The reasoning behind accepting that column on the right: a pilot with one company and unproven revenue should cheap out on exactly one thing, availability, while keeping the security fundamentals real. Cheaping out on encryption or backups would be borrowing against a bill that arrives with someone else's payroll data attached.