lensesio / kafka-topics-ui

Web Tool for Kafka Topics |
https://lenses.io
877 stars 148 forks source link

Configurable port for Web UI when using Docker #94

Closed PHameete closed 6 years ago

PHameete commented 7 years ago

Currently, the kafka-topics-ui, schema-registry-ui and kafka-connect-ui are reachable on localhost:8000 by default. The port is not configurable which prevents using the three docker images simultaneously.

Could the port used by the UI's running in a Docker container be made configurable via an environment variable?

Antwnis commented 7 years ago

Hi @PHameete

Within the docker the port number as you mention is 8000

If you study a little bit more the docker documentation, you can find that docker allows port mappings. i.e.

docker run --rm -it -p 8000:8000 \
           -e "KAFKA_REST_PROXY_URL=http://kafka-rest-proxy-host:port" \
           -e "PROXY=true" \
           landoop/kafka-topics-ui

Look at -p 8000:8000

Here we are mapping the internal port 8000 to the external world port 8000

By switching the above to -p 8000:8001 you can move the exposed port to 8001

Please close this ticket, if the answer addresses your issue 👍

PHameete commented 7 years ago

Hi Antwnis,

Sorry I was getting so used to the Confluent Docker images that I believed I needed this to make a port configurable. Indeed you are right we can also use Docker to do this :-)

It is the other way around though -p hostport:containerport in case anyone else needs this.

Thanks again for your swift reply. Closing the issue.

Antwnis commented 7 years ago

Great, u are right on the hostport/containerport i always get them wrong :)

As you are into dockers & Kafka - have a look at https://www.landoop.com/docs/lenses/developers and let us know what u think

PHameete commented 7 years ago

Hi @Antwnis I'd like to re-open this because I believe there is still something to say for configurable port when for example using the 'host' network. What are your thoughts on this?

andmarios commented 6 years ago

We just added support for custom port. You may set it via the PORT environment variable. E.g:

docker run -e PORT=10205 --net=host...
PHameete commented 6 years ago

@andmarios excellent. Thank you very much :-)