> I also enabled UFW (which I should have done ages ago):
Docker will overwrite your rules when you publish ports.
Do not publish ports with docker. Do not run internal services on the publicly accessible system.