diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2bb799f --- /dev/null +++ b/.env.example @@ -0,0 +1,12 @@ +CF_API_TOKEN= +CF_ZONE_ID= +DOMAIN=example.com +TARGET=192.0.2.10 +RECORD_COMMENT=managed by traefik-cloudflare-dns +DELETE_AFTER=1h +# RECORD_TAGS= +# PROXIED=false +# TTL=1 +# RESYNC_INTERVAL=1m +# DRY_RUN=false +# LOG_LEVEL=info diff --git a/README.md b/README.md index 58abd0f..6bd7d8e 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ A typical setup is one wildcard record (`*.example.com`) for your main server, p ## Quick start +The repo's [`compose.yml`](compose.yml) is ready to deploy as is, for example as a Docker Compose app in Coolify on each server. Copy [`.env.example`](.env.example) to `.env` and fill in the four required values. The minimal form is: + ```yaml services: traefik-cloudflare-dns: diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..2e90f3c --- /dev/null +++ b/compose.yml @@ -0,0 +1,30 @@ +services: + traefik-cloudflare-dns: + image: ghcr.io/tiennm99/traefik-cloudflare-dns:edge + restart: unless-stopped + environment: + - CF_API_TOKEN=${CF_API_TOKEN:?CF_API_TOKEN is required} + - CF_ZONE_ID=${CF_ZONE_ID:?CF_ZONE_ID is required} + - DOMAIN=${DOMAIN:?DOMAIN is required} + - TARGET=${TARGET:?TARGET is required} + - DOCKER_HOST=tcp://dockerproxy:2375 + - RECORD_COMMENT=${RECORD_COMMENT:-managed by traefik-cloudflare-dns} + - DELETE_AFTER=${DELETE_AFTER:-1h} + # - RECORD_TAGS=${RECORD_TAGS:-} + # - PROXIED=${PROXIED:-false} + # - TTL=${TTL:-1} + # - RESYNC_INTERVAL=${RESYNC_INTERVAL:-1m} + # - DRY_RUN=${DRY_RUN:-false} + # - LOG_LEVEL=${LOG_LEVEL:-info} + depends_on: + - dockerproxy + + dockerproxy: + image: tecnativa/docker-socket-proxy:latest + restart: unless-stopped + environment: + - CONTAINERS=1 + security_opt: + - no-new-privileges:true + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro