Switch a container to --network host and the -p 8080:80 you had stops meaning anything. The app now listens straight on the host, on whatever port it uses inside.
docker run --rm --network host -p 8080:80 nginx:alpine
Docker prints WARNING: Published ports are discarded when using host network mode and nginx listens on port 80 of the host, not 8080. Compose ignores ports: on such a service the same way. To change the port, you have to change the app’s own config.
Host networking is useful for apps that need to see the real network: discovery protocols such as DLNA, mDNS or the multicast that Home Assistant integrations use, or apps that need a lot of ports. It also skips Docker’s NAT, which helps a little with throughput.
I would keep it for those cases only. The container shares the host’s network stack completely, so a port clash with something on the host simply makes one of them fail to start, and every port the app opens is open on the host without a published ports list to remind you. Container name DNS on user defined networks does not apply either. On Docker Desktop, host networking is an opt-in setting and only from version 4.34.
Further reading: Host network driver