From 7d9d61cbba87adb88d1383001c194266e0b735b2 Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Sun, 31 May 2026 15:00:15 +0200 Subject: [PATCH] feat: add Caddy reverse proxy stack for bloombase.kerkman.io MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xcaddy build with caddy-dns/cloudflare for DNS-01 TLS. Host network mode so Caddy can reach other Docker stacks on localhost. Designed as general reverse proxy — add new site blocks to Caddyfile for future services. Deployed to dockerhost:/home/stephan/stacks/caddy/ Co-Authored-By: Claude Sonnet 4.6 --- caddy/.env.example | 1 + caddy/.gitignore | 1 + caddy/Caddyfile | 7 +++++++ caddy/Dockerfile | 6 ++++++ caddy/docker-compose.yml | 15 +++++++++++++++ 5 files changed, 30 insertions(+) create mode 100644 caddy/.env.example create mode 100644 caddy/.gitignore create mode 100644 caddy/Caddyfile create mode 100644 caddy/Dockerfile create mode 100644 caddy/docker-compose.yml diff --git a/caddy/.env.example b/caddy/.env.example new file mode 100644 index 0000000..f96267b --- /dev/null +++ b/caddy/.env.example @@ -0,0 +1 @@ +CLOUDFLARE_API_TOKEN=your_token_here diff --git a/caddy/.gitignore b/caddy/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/caddy/.gitignore @@ -0,0 +1 @@ +.env diff --git a/caddy/Caddyfile b/caddy/Caddyfile new file mode 100644 index 0000000..016c5c8 --- /dev/null +++ b/caddy/Caddyfile @@ -0,0 +1,7 @@ +{ + acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN} +} + +bloombase.kerkman.io { + reverse_proxy localhost:8083 +} diff --git a/caddy/Dockerfile b/caddy/Dockerfile new file mode 100644 index 0000000..fe6cb41 --- /dev/null +++ b/caddy/Dockerfile @@ -0,0 +1,6 @@ +FROM caddy:builder AS builder +RUN xcaddy build \ + --with github.com/caddy-dns/cloudflare + +FROM caddy:latest +COPY --from=builder /usr/bin/caddy /usr/bin/caddy diff --git a/caddy/docker-compose.yml b/caddy/docker-compose.yml new file mode 100644 index 0000000..943d398 --- /dev/null +++ b/caddy/docker-compose.yml @@ -0,0 +1,15 @@ +services: + caddy: + build: . + container_name: caddy + restart: unless-stopped + network_mode: host + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + - caddy_data:/data + - caddy_config:/config + env_file: .env + +volumes: + caddy_data: + caddy_config: