Docker Compose with Caddy
deploy/compose.yaml runs Gone behind Caddy, which gets and renews a Let’s Encrypt certificate on its own. It is the quickest way to run Gone for real.
What you need
- A DNS name (an
AorAAAArecord) pointing at the server. - Ports
80and443open to the internet. Caddy needs both to get a certificate. - Docker with the Compose plugin.
Start it
mkdir gone && cd gone
curl -fsSLO https://raw.githubusercontent.com/haukened/gone/main/deploy/compose.yaml
curl -fsSLO https://raw.githubusercontent.com/haukened/gone/main/deploy/Caddyfile
GONE_DOMAIN=gone.example.com docker compose up -dThen visit https://gone.example.com. To avoid typing the domain each time, put GONE_DOMAIN=gone.example.com in a .env file next to compose.yaml.
What the files set up
- Only Caddy is published. Gone listens on a private Docker network (
172.31.255.0/28) and is never reachable directly. Caddy redirects HTTP to HTTPS and proxies togone:8080. - HTTPS headers. Caddy sends
Strict-Transport-Security(one year, including subdomains) and removes itsServerheader. Gone sets the other security headers itself. - Rate limits per visitor. Caddy has a fixed address on that network (
172.31.255.2), and Gone trusts only that address (GONE_TRUSTED_PROXIES: 172.31.255.2/32) forX-Forwarded-For. Without it, every visitor would share Caddy’s single budget. If the subnet collides with one of your networks, change it, Caddy’sipv4_addressandGONE_TRUSTED_PROXIEStogether incompose.yaml. - Hardened containers. Gone and Caddy both run with a read-only root filesystem, all Linux capabilities dropped, and
no-new-privileges. Gone writes only to itsgone-datavolume. Caddy writes to itscaddy-dataandcaddy-configvolumes and a/tmptmpfs, and keeps onlyNET_BIND_SERVICEso it can bind ports 80 and 443. - Ordered start. Caddy waits until Gone’s health check passes.
Changing settings
Add variables under the gone service’s environment:. For example, to shorten the longest expiry and allow smaller secrets:
services:
gone:
environment:
GONE_TRUSTED_PROXIES: 172.31.255.2/32
GONE_TTL_OPTIONS: 5m,30m,1h,4h
GONE_MAX_BYTES: "1048576"Every variable is listed in Configuration. Apply changes with docker compose up -d.
Updating
docker compose pull && docker compose up -dcompose.yaml pins Caddy to a tag and digest (bump both together; Dependabot does this if you keep the file in a repository). It uses the latest tag for Gone. To control upgrades, pin a release instead, for example ghcr.io/haukened/gone:v3.12.0, and verify it before you switch. For more on upgrades, see Upgrade and maintain.