A Docker-based Caddy web server template with Cloudflare DNS and Layer 4 proxy extensions pre-built.
- Caddy 2.11.2 with caddy-dns/cloudflare and caddy-l4 modules
- Docker Compose setup with persistent data/config volumes
- A dedicated
caddy_networkbridge network for connecting other services - Static file serving on port 80 with a default status page
├── compose.yaml # Docker Compose service definition
├── dockerfile # Multi-stage build: xcaddy builder → runtime image
├── config/
│ └── Caddyfile # Caddy configuration (serves /srv on :80)
├── static/
│ └── index.html # Default "Service Active" status page
└── tests/
└── integration_test.sh
docker compose up -d
curl http://localhostTo rebuild after changes:
docker compose up -d --buildEdit config/Caddyfile to customise routing, TLS, reverse proxying, etc. The file is bind-mounted, so you can reload without rebuilding:
docker compose exec caddy caddy reload --config /etc/caddy/Caddyfile- Create a folder inside
config/caddy-configs/folder - You must have
index.caddyfilethat may have your configs, also support importing other .caddyfile within the root of the folder your created.
Other Compose services can join the pre-existing network:
services:
app:
image: my-app
networks:
- caddy_network
networks:
caddy_network:
external: truedocker compose down # stop and remove containers
docker compose down -v # also remove volumes