Based on this compose file the web tier should be able to resolve the database by the network name db and the db should be able to resolve the web tier by the name web.
Unfortunately at the moment there is a bug that should be fixed soon. the work around this at the moment is as follows:
in the docker files where you build your containers, you need to add the following statement:
#FIX DNS issues currently in Windows Containers
RUN powershell set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord
You need to add this line to each container that needs to reach out on the network and find the other container when using the NAT network.
So in case of my example this needs to be added to the Docker file of the web application, since it will go out and try to reach the database.
Hopefully this will be fixed soon, but in the meanwhile this can help you make things work.