feat: dynamic DNS updater sidecar (auto-updates A + AAAA every 5min)

- update-dns.sh: detects public IPv4/IPv6, upserts CF records
- Runs on container start + every 5 minutes
- Only updates if IP actually changed (skips if unchanged)
- python:3-alpine container with curl

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-30 11:34:05 +04:00
parent 850944944d
commit b22200e3be
2 changed files with 110 additions and 0 deletions

View File

@@ -82,6 +82,18 @@ services:
networks:
- backend
# ─── Dynamic DNS updater (keeps A + AAAA current) ───
dns-updater:
image: python:3-alpine
restart: unless-stopped
volumes:
- ./update-dns.sh:/update-dns.sh:ro
secrets:
- cf_api_token
entrypoint: ["/bin/sh", "/update-dns.sh"]
environment:
DNS_UPDATE_INTERVAL: "300" # 5 minutes
secrets:
cf_api_token:
file: ./cf_api_token.txt