How to access the docker container with public IP

  docker, docker-compose, docker-swarm, rest

3 images are built and deployed into 3 different nodes in Docker Swarm on PWD. When I run images on Manager Node then it is distributing with other Worker Nodes themselves.

EX – I have 3 services as consumer, producer, and database. producer is running on Manager Node and other other two services are running on Worker Nodes.

When I try to access the consumer service container which is running on Worker Node by using public IP Of Worker Instance and it is failed. enter image description here

How can I access the container which is running on a cloud instance with the public IP from the local machine? should I have to pass some parameters with the REST API call?

Source: Docker Questions