AFAIK changing the port has to be done in the lighttpd.conf file. But any changes at that level will be overwritten with any upgrade.
DNS setting are the upsteam DNS not local. So for DNS1 will be 9.9.9.9 for Quad9, 8.8.8.8 for Google or whatever you fancy. All this can be done in the web gui, so shouldn't be necessary in the script.
I just checked Pi-Hole Docker page here and according to developer:
QuoteUpgrade Notices:
Docker Pi-Hole v4.2.2
- ServerIP no longer a required enviroment variable! Feel free to remove it unless you need it to customize lighttpd
- --cap-add NET_ADMIN no longer required unless using DHCP, leaving in examples for consistency
Docker Pi-Hole v4.1.1+
Starting with the v4.1.1 release your Pi-hole container may encounter issues starting the DNS service unless ran with the following setting:
--dns=127.0.0.1 --dns=1.1.1.1
The second server can be any DNS IP of your choosing, but the first dns must be 127.0.0.1
Which is good news. I will upgrade to newest version. Script can be simplified and 2 of my concerns are solved