'More Docker containers on same port
I'm studying Docker Desktop, and I have a question.
I have created two ASP.NET Core applications that are listening on the same port. I would like to have them respond by name (i.e.: http://app1.local/ and http://app2.local/). Is it possible with Docker?
Thanks
Solution 1:[1]
You can only have one process listening on a given port, so to achieve what you want, you can have a reverse proxy listening on the port and direct traffic to the applications behind, based on the host name in the request.
Some options for reverse proxies are Nginx, Traefik or the Ocelot library for .NET.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Hans Kilian |
