Interview Prep/Docker/Networking, DNS and Compose

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.

All Docker questions Roadmap: Docker & containers

More on Networking, DNS and Compose