In the referred tpic that is not port 0, just the IP address to listen on every available IP addresses. I would understand that, but you want to use port 0 as target port.
HTTPS is not just a choice that you make and tell the server to listen on HTTPS protocol. You need to provide TLS certificates. This is true with and without Docker too. I don’t see certificates in your shared codes.
Again. I don’t see any certificate settings in your code.