@mr-varga I’m not sure, you seem to be doing the right things. In theory it should work.
I have never tried something like that before, so I have nothing to share. I would troubleshoot around verifying whether you have actual access to the influxDB machine. Have you tried from within the same network using the local IP (e.g something like 192.168.1.xxx:80806), rather than duckdns address, just to exclude you have some issues there?
Have a look at point 7 here: Complete guide on setting up Grafana/InfluxDB with Home assistant using official Docker images
What did you link to duckdns? Did you use the http://a0d7b954-influxdb:8086 address? as far as I understand this is only accessible by localhost.
Can you post your Grafana data source settings?