Shortener Presets
Production Docker Compose: Postgres 16 + Redis 7 + Caddy 2
Pin exact memory limits, Redis no-persistence LRU cache flags, Postgres 16 async WAL commits, and local healthchecks in one Compose blueprint.
Zero Redis RDB Fork Stalls · Async WAL · Isolated Bridge Net
Why Redis Should Run Ephemerally for URL Shorteners
In Kutt v3 and Shlink, PostgreSQL is the durable system of record for all short links. Disabling Redis RDB snapshots (--save "") prevents copy-on-write memory spikes during high-RPS redirect bursts.
Binding Internal Ports Strictly to Loopback
Never expose PostgreSQL (5432) or Redis (6379) on 0.0.0.0. Keep Docker port bindings internal or on 127.0.0.1 so only Caddy touches the public internet.
Measured Thresholds & Shortener Stack Parameters
| Service Container | Pinned Runtime Flag | Stability Effect |
|---|---|---|
| redis:7-alpine | --save "" --maxmemory-policy allkeys-lru | Disables RDB background fork pauses; Postgres remains source of truth |
| postgres:16-alpine | -c synchronous_commit=off | Doubles click-event insert throughput with negligible crash window |
| kutt / shlink | read-only .env.kutt + restart: unless-stopped | Ensures clean container recovery across host security reboots |
| caddy:2-alpine | Ports 80/443 + HTTP/3 QUIC | Binds public TLS while keeping app & DB ports on 127.0.0.1 |