Skip to content

Instantly share code, notes, and snippets.

@xjoker
Created July 4, 2025 10:48
Show Gist options
  • Save xjoker/28c10df4edfa6907919f2dff6c743998 to your computer and use it in GitHub Desktop.
Save xjoker/28c10df4edfa6907919f2dff6c743998 to your computer and use it in GitHub Desktop.
build caddy
FROM --platform=linux/amd64 caddy:2-builder AS builder
RUN apk add --no-cache build-base brotli-dev
RUN CGO_ENABLED=1 xcaddy build \
--with github.com/caddy-dns/cloudflare \
--with github.com/mholt/caddy-ratelimit \
--with github.com/mholt/caddy-l4 \
--with github.com/dunglas/caddy-cbrotli
FROM --platform=linux/amd64 caddy:2
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment