Using other ports than 80 and 443 - HowTo?

The only supported workaround is configuring what is listening on the ports 80 and 443 to pass requests to a subfolder of the main domain to the Discourse container. That is documented at Subfolder support with Docker.