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
