A container on two networks has two addresses, and they are buried deep in docker inspect. A short Go template lists them with the network names.
docker inspect --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}={{$v.IPAddress}} {{end}}' myapp
The output looks like bridge=192.0.2.4 proxy=198.51.100.3 (example addresses). The range loops over the networks map, $k is the network name and $v.IPAddress the address on it.
For just the addresses, the shorter form works too:
docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}' myapp
I think you mostly need this to test a service from the host with curl, or when a firewall rule needs the container’s address.
Do not hard code what you find. Container addresses on Docker networks are handed out at start, and a recreated container usually gets a different one. Between containers, use the service or container name on a shared user defined network instead. A stopped container has no address at all. And on Docker Desktop these addresses live inside the VM, so your Mac or Windows host cannot reach them directly.
Further reading: Format command and log output, docker container inspect