This docker build file is created in order to build caddy with the:
replace-response
,cloudflare
and,caddy-security
modules.
Download the file Dockerfile
to an empty directory and issue:
docker build -t TAG .
where:
TAG
represents a tag to set on the built image (ie: redis:latest
)
After caddy is built, a container can be created and ran either via docker run
or deployed within the swarm with docker stack deploy
.
Note that if the image is to be deployed to a swarm, then more than likely the image should be committed to a local registry serving the local docker swarm.
FROM caddy:builder-alpine AS builder RUN xcaddy build \ --with github.com/caddyserver/replace-response \ --with github.com/caddy-dns/cloudflare \ --with github.com/greenpau/caddy-security \ --with github.com/caddy-dns/duckdns FROM caddy:latest COPY --from=builder /usr/bin/caddy /usr/bin/caddy