I am trying to connect my kafka setup with zookeeper contain exposed to a different port other than the default port, however when I change the port to 2181 the container is running fine but if I change the port in my yml file I am not able to run it, any guidance would be helpful.
version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
ports:
- "2182:2181"
kafka:
image: wurstmeister/kafka
container_name: kafka
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2182