If you would like to use TLS you need to use 5671 port. Port 5672 is a default port for non-TLS communication.
Please check if 5671 port is opened.
If not – this needs to be configured on docker side as well. If you need any help with this – please write us back here.