Collabora online port (443/9980)

I just installed the CODE docker image with an ngninx HTTPS reverse proxy on the same machine which can then be reached under from anywhere and was wondering how safe it is to have the CODE docker image reachable through HTTPS from the whole internet?

As far as I understand this is a necessity for Nextcloud to interact with the docker CODE image.