Published port is reachable from the internet though `ufw` denies it.
AdvancedTroubleshootingNetworking, DNS and Compose
Answer
Likely causes → Docker's DNAT rules bypass ufw's INPUT rules.
Diagnose → iptables -t nat -S DOCKER; scan with nmap -p 8080 host.
Fix → Bind 127.0.0.1:8080:80, or add rules to DOCKER-USER, or use ufw-docker tooling, or set "iptables": false (with caution).
Prevent → Publish only what needs to be public.
More on Networking, DNS and Compose
`curl: (7) Failed to connect to localhost port 8080: Connection refused` after `docker run -p 8080:80 nginx`.Beginner`Bind for 0.0.0.0:5432 failed: port is already allocated`BeginnerContainers cannot reach the internet: `Temporary failure in name resolution`Advanced`ping` works to IPs but DNS names fail on the default bridge: `ping: bad address 'db'`Beginner`getaddrinfo ENOTFOUND db` in a Compose app.BeginnerCompose: `service "api" depends on undefined service "db"`Beginner