Exposing different ports via Docker


I am trying to setup multiple servers via docker.
When the ports are exposed 55414:55414 then I can connect to the webinterface.
Since I would like multiple servers from the same Docker Host, the servers will need different port numbers exposed, eg. 90:55414 and 91:55414
Locally this partially works, in that the webinterface loads eventually after a couple of refreshes.
This does not work from an external network, i.e. router config = 55414:90, docker config = 90:55414
I have tried adding the tcp flag to the container, with no change in results. This is an intermediary test, ultimately I would like to have 55414 point to my load balancer which can then direct traffic to the service via acl, however, I am stuck with traffic failing when I use a custom port on the container externally

I don’t understand the problem and Chat GPT is not as helpful as it used to be
Guidance to get me out of my ignorance would be sincerely appreciated

Thank you

I have taken testing a step further by incorporating HAProxy in the same stack as URBackup. Exposing ports 55413-55415 on the HAProxy service, setting up a front end for each port, with an ACL and then also a backend for each port pointing to the URBackup service by docker service name (not by IP nor hostname)
From the stats page HAProxy shows the connection to backends as alive, however, never do I see any traffic comming in through the default ports.

to clarify, router is set to open ports 55413-55415 and point them to this stack 55413-55415.
docker exposes port 55413-55415 to HAProxy in the stack, with HAProxy binding to each port on an individually configured frontend

incomming connection does not reach URBackup

Just curious, what type of access control lists would you be using? What methods?

Hi ProfoundIT, thank you for taking a moment to respond. If I can resolve the current issue with custom ports I would like to use HAProxy ACL, so each client can have their own domain pointing to the three required ports for their server: eg: acl myURB hdr(host) -i me.domain.com

Some of this is Greek to me, no load balancer or Docker experience to speak of, but the pain point sounds like the traversal into the Docker container. Have you tried another application, like say Apache or something simple to setup in said Docker container to see if you can get the internal Docker container networking aspect to work properly before moving to UrBackup?

Hopefully someone else will take the baton here. :+1:

Docker networking works fine with the default ports (and all the other services running), I have logged a support request on Docker forums as well.

Good luck :+1:

I may be running into this problem shortly as well as I’m looking to deploy on Docker

Please report back to us if you have time. Best.

I’ve created a new docker network, started up a container for HAProxy and another two separate containers, each running UrBackup. Exposing only the default UrBackup ports on the HAProxy container (no ports exposed on the UrBackup containers as HAProxy is on the same network and will handle traffic internally) in HAProxy config file, UrBackup Container Nr.1 is setup as the default backend. UrBackup Container Nr.2 is setup as a standalone backend. Traffic runs via default ports, from my browser to HAProxy and then to the default backend, works flawlessly. The problem is when I try to direct traffic with HAProxy, the traffic does not meet the intended destination, ending up at the default backend. ACL in HAProxy does not capture the difference in the data stream in order to direct the flow. How can I get info from the UrBackup tcp stream? this is needed to direct traffic. How do I distinguish UrBackup tcp packets?