Can't connect to dockerized kafka (used wurstmeister/kafka-docker) from outside the server

I'm trying to connect kafka, which is running on docker conatiner (on EC2 server).

I cloned wurstmeister/kafka-docker, and edited docker-compose-single-broker.yml file like below.

version: "2"
    image: wurstmeister/zookeeper
      - "2181:2181"
    build: .
      - "8092:9092"
      KAFKA_ADVERTISED_HOST_NAME: # (my EC2 server ip address)
      KAFKA_CREATE_TOPICS: "test-topic:1:1" # topic_name:partition:replica
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      - /var/run/docker.sock:/var/run/docker.sock

I changed port 9092:9092 to 8092:9092, because my EC2 server doesn't allow port over 9000.
Ip is an example.

With this docker-compose, I successfully started kafka and zookeeper container. Then, I used console-producer and console-consumer on same EC2 server to test kafka connection like below.
$ bin/ --broker-list --topic test-topic
$ bin/ --bootstrap-server --topic test-topic --from-beginning

It worked well on my EC2 server, but I couldn't do the same on my local shell. It seems like it doesn't allow access from outside the server. How can I change my docker-compose file to make it possible to access from other server?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum