Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Latest commit

 

History

History
65 lines (53 loc) · 1.37 KB

README.md

File metadata and controls

65 lines (53 loc) · 1.37 KB

create and publish docker image docker image size github code size in bytes

caddy-cf

A caddy docker image containing the cloudflare & dynamicdns modules.

docker-cli

volumes

docker volume create caddy_config
docker volume create caddy_data

container

docker run -d \
  --name caddy \
  --restart unless-stopped \
  --network host \
  -e CLOUDFLARE_API_TOKEN=cf_api_token \
  -v "$PWD"/Caddyfile:/etc/caddy/Caddyfile \
  -v caddy_config:/config \
  -v caddy_data:/data \
  ghcr.io/haq/caddy-cf

caddyfile

{
    email email_address_for_notifications
    dynamic_dns {
        provider cloudflare {env.CLOUDFLARE_API_TOKEN}
        domains {
            domain.com sub
            domain.com sub1
        }
        check_interval 5m
        ip_source simple_http https://icanhazip.com
        versions ipv4 ipv6
        ttl 1h
    }
}

(cloudflare) {
    tls {
        dns cloudflare {env.CLOUDFLARE_API_TOKEN}
    }
}

sub.domain.com {
    import cloudflare
    reverse_proxy ip:port
}

sub1.domain.com {
    import cloudflare
    reverse_proxy ip:port
}