My docker-compose
-based Caddy setup re-created the container and hence created a new docker volume with only the autosave.json
whenever it was restarted. Since it was auto-restarted once a minute, this led do over 70000 volumes piling up in /var/lib/docker/volumes
.
The Caddy log shows that Caddy is creating /config/caddy/autosave.json
:
mycaddy_1 | {"level":"info","ts":1637877640.7375677,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
I fixed this by mapping /config/caddy
to a local directory:
- ./caddy_data:/config/caddy/
Complete docker-compose.yml
example:
version: '3.5' services: mycaddy: image: 'caddy:2.4.6-alpine' volumes: - ./caddy_data:/config/caddy/ - ./static:/usr/share/caddy - ./Caddyfile:/etc/caddy/Caddyfile ports: - 19815:80