Using docker-compose for container orchestration, establish https communication between an MVC UI and a .NET Web API each in separate containers.
- Remove the
EXPOSE 80
andEXPOSE 443
from each Dockerfile - In docker-compose.yml add ports to each service. I added
- "49161:443"
to my UI service and- "49162:443"
to my API service. - Remove ports sections from each service in docker-compose.override.yml
I'm not 100% satisfied with this solution. Networking in Compose promises a cleaner solution to this problem. Seems like either way, I will ultimately need to store the hostname with its port (i.e. localhost:49162) in some kind of environment variable.