What does `host.docker.internal` do?

IntermediateConceptNetworking
Answer

It resolves to the host machine from inside a container on Docker Desktop. On Linux Docker Engine you add it explicitly: --add-host=host.docker.internal:host-gateway (or extra_hosts in Compose). Use it for a container to reach a service running on the host.

All Docker questions Roadmap: Docker & containers

More on Networking