Both are only used inside the compose network (services reach them by name,
postgres:5432 / redis:6379). Publishing on 0.0.0.0 exposed them to the
internet — Docker's DNAT rules bypass ufw, so the ports were reachable
despite the firewall having no allow rule for them. Bind the published
ports to 127.0.0.1 so external access requires an SSH tunnel.