I have a 3rd party application. Basically I need to run one instance of that application for a one user. For 10 users I have to run 10 instances. From my API I want to communicate with a specific client based on API parameters. Please check the attached image.
I have two methods and each have some issues.
1. using multiple ports
I can record port number in a database and forward API data to specific instance. For example localhost/instances:4501;
Issues is it's not scalable as there is a limit in port addresses. Also identifying usable ports is another challenge without interface with other applications.
2. Using docker network
with this approach I don't need to assign ports , I can just name containers as instance1,intance2 and can forward traffic to specific instance. How ever with this approach I cannot run application with docker. I want to run my application without docker as well.
Which approach is better? And is there any other best way to achieve this? thank you
-
Do your API and Clients communicate over http?Darem– Darem01/12/2021 07:42:57Commented Jan 12, 2021 at 7:42
-
@Darem Both api and clients exist in the server .Yes I'm using http internal api to communicate with clients.for example http/localhost:portofclientA or http/clientA using docker networkFast Snail– Fast Snail01/12/2021 07:47:11Commented Jan 12, 2021 at 7:47
-
And your "application" runs without docker and your clients/instances are docker container?Darem– Darem01/12/2021 07:53:45Commented Jan 12, 2021 at 7:53
-
@Darem i have 2 ways to do.i'm trying to find the best way or another method. I use docker containers and docker network also i used applications without docker and used ports communicate so different clients has different ports.Fast Snail– Fast Snail01/12/2021 07:56:48Commented Jan 12, 2021 at 7:56
-
Ok I´m a little bit confused by this sentence "How ever with this approach I cannot run application with docker. I want to run my application without docker as well."Darem– Darem01/12/2021 07:57:51Commented Jan 12, 2021 at 7:57