Windows 10, docker for windows, simple webapp using nginx and ssl.
Simple thing when using VMs. I have three virtual machines. Every machine has static ip assigned by router. In hosts files I can map ips to host names so I'm able to comunicate between VMs using names: api1.mydev, api2.mydev, application.mydev. Of course all systems have access to other part of network parent. This simple thing took me few days in docker without any progress.
It was super simple to build docker images/containers and they work on custom ports, so localhost:443 works like a harm. I can't find way to:
- use host name to connect to naginx@docker_container as container's ip changes with every sytem reboot.
- assign host names to many containers as its impossible to define port in hosts file
I've tried nginx-proxy but it gives me 502 errors. I've found traefik but I'm not network guru and configuration looks overhelming for newbie.
The option i thought about is to put all services on one container and use nginx to resolve names but this method gives not true advantages over single VM machine and is against docker philosophy.
Is there is simpler way to achieve that? I have feeling that I've missed something in docker configuration.