mikrotik-netbox-dns-sync Deployment
NetBox to MikroTik static DNS sync: source/mikrotik-netbox-dns-sync.
Runs the script every 5 minutes on the cron image (bryanpedini/cron), logging to the container output. Nothing is built: the crontab and a checkout of the source repo are bind mounted, and python3 (plus tzdata) is installed with apk when the container starts.
Usage
cp env.example .env
chmod 600 .env
$EDITOR .env
git clone https://git.bjphoster.com/source/mikrotik-netbox-dns-sync.git data/source
docker compose up -d
crontab must be owned by 0:0, as crond requires.
Every SYNC_* variable in .env is passed to the script without the prefix (SYNC_NETBOX_URL becomes NETBOX_URL, and so on), except SYNC_SOURCE, the path of the source checkout. See the source README for every variable and for the NetBox and RouterOS permissions.
env.example ships with SYNC_DRY_RUN=true. Run one sync by hand and check the plan before setting it to false and running docker compose up -d again:
docker compose exec cron python3 /jobs/netbox_dns_sync.py
docker compose logs -f
Update
git -C data/source pull
The next run picks up the new script, no restart needed. Crontab changes need a docker compose restart.