Cannot access container server with --net=host

My guess is that you use Docker Desktop. That will not work. You need port forward.

See https://learn-docker.it-sziget.hu/en/latest/pages/advanced/kernel-namespaces-network.html#running-a-web-browser-in-a-net-namespace-in-a-vm-docker-desktop

This slide can illustrate how you have three localhosts and the host network will mean the host of the virtual machine.