How to connect to the database externally under discourse container deployment method, for example using DBeaver

In the discourse container deployment method, how to connect to the database externally, for example using DBeaver to connect