# caddy/ (episode 10) Custom Caddy image with the rate limiting plugin compiled in. The stock `caddy:2-alpine` has no `rate_limit` directive; it is not a runtime flag, the module must be built into the binary with `xcaddy`. `compose.yml` carries both `image:` and `build: ./caddy`, so `docker compose build caddy` produces `selfhostedops/caddy:ratelimit` locally and `docker compose up -d` uses it. Do not build on a small box while the stack is running - a Go build can push a 2 GB machine into OOM and take the live services down with it. Build it elsewhere (a bigger machine, or a throwaway host) and move it over: docker build -t selfhostedops/caddy:ratelimit ./caddy docker save selfhostedops/caddy:ratelimit | ssh root@box docker load