Docker Community Forums

Share and learn in the Docker community.

Best way to have two applications that both use a specific port (e.g., port 80)

Port 80 is very valuable… I have two applications that seemingly must use it…

  1. Web browser (traefik mediated, multiple nginx websites, but obviously web queries default to port 80…)
  2. Amazon Alexa hubs / services from node-red… emulating alexa devices requires port 80.

What is the best way to accommodate this?

My first thought:
Expose #1 on port 80 as usual
For #2, create a second network subnet via macvlan, on my router’s network, and expose port 80 there for that service.

Thoughts?

Thank you very much

Greg

“best way” pretty much depend on your use case, what services your environment provides and how much experience the person you ask has with operating containerized stacks.

If you are in controll of name resolution, what’s wrong with using Treafik as reverse proxy and leverage full quallified domain names to route traffic to the desired backend container?

1 Like

Dear @meyay

When alexa searches for devices, I don’t believe it relies upon name resolution in any way. The devices on the network often have no name resolution service - it is likely a netcast of some type.

Therefore, I do not think traefik can help me here.

Ah, so the alexa emulator acts on smtl. like multicast. This indeed requries the container to run in host network (which is not applicable b/c already occupied) or macvlan.

I agree that this is a valid reason to use macvlan. Though, I am not sure how multicast will work if the emulator works in a different subnet than your alexa devices is (regardless wether with or without docker).

Sounds like a topic better be anwser by someone that is actualy using the alexa emulator as well.

I know that this does work if your docker container can expose port 80.
My thought is that I will assign an IP address within my local subnet (192.168.2.0/24)
e.g., if my main router is assigned 192.168.2.2, then I will assign it 192.168.2.3 (and make sure that the router does not assign that address)