We have a microservice architecture with each microservice currently being hosted in its own process, and deployed via its own docker image. Totally school book separated. On a source level, all services are maintained in the same git repo and in the same solution. We face the same problem as many others, though, with the strict separation. See the paper "Towards Modern Development of Cloud Applications" [1] for elaboration.
How can do a "merge" of our existing services in .net and have them run in the same hosting process? Ultimately, we would like to keep the current service endpoints, for example:
example.com/myservice1example.com/myservice2example.com/myservice3
with all services running on the same port, but each serving its own swagger UI? For example:
example.com/myservice1/index.htmlexample.com/myservice2/index.htmlexample.com/myservice3/index.html
Context for the above question: .net 6 and web api...
I am not sure you can host them in one process. Normally you would use a layer 7 load balancer or proxy to achieve this and route the traffic.
There are many ways to do this either a hosted service like Azure Front Door, nginx in a docker container or software level like YARP Proxy