Best practices for Dockerized RabbitMQ in IAAS environment?

I’m trying to get RabbitMQ clients – one co-located on the same Docker host (A) and one on another machine (B) on a different subnet – to connect to RabbitMQ running on host A.

I’m starting the docker containers with Docker Composer and everything starts fine, but I can’t seem to get to RabbitMQ on port 5672/tcp from host B. I can connect from within the RabbitMQ container as well as from Docker host OS on A.

I’ve specified “5672:5672” in docker-compose.yml. I’ve also tried connecting to 5672 on Docker host OS on A.

ss -lnt shows the port open within the RabbitMQ container. ss -lnt on Docker host A does not show that port open.

What’s the best way to configure this scenario? I’ve been pursuing an “expose the port via the host OS on A and use a firewall to limit connections only from host B” strategy, but can’t seem to get it to work.

Any help is appreciated!

Thanks -

Shane O.