Dockerize Spring Boot Java app with Kafka, Zookeeper, and MongoDB

If all containers run on the same node, you could connect them via the bridge network. Or the containers expose the ports and use the host network.

If containers will run on different nodes, you should use the overlay network.

You would want to run multiple replicas for Kafka, ZooKeeper and MongoDB. There is a good discussion about how to handle replication for them.