A docker build script of Caddy, with telemetry disabled, provided in a light container.
This way, you can obtain a clean and free build of the server (unlike the non-free binaries resulting from Caddy's permissive license).
The binary provided is also statically linked, making deployment easy !
Current version supported :
v1.04
- Bash script :
Run build.sh
. You should obtain a caddockery
executable. (Requires go
on your machine)
- Dockerise it : (~20MB! )
Run docker build . -t caddockery
Use it as a base image for your needs and add a caddyfile to it : you can put a file inside the container, mount a volume or provide some parameters ...
Don't forget to expose the required ports !
Take a look at the example.Dockerfile
in the example
folder.
Build and run :
docker build -f example.Dockerfile . -t example
docker run -p 8000:8000 example
Open localhost:8000 in your browser to see if everything is working !
When using TLS, caddy stores the certificates in .caddy
.
It is recommended to save certificates on the host machine to prevent regeneration every time container starts.
Mount a volume with -v $HOME/.caddy:/.caddy
for example.
You might want to use a folder on your host to serve your files from, in order to do that just add -v folderToMount:/html
Please refer to the original project for more information :
Download -
Documentation -
Community