so in a docker container how would one go about connecting directly to the postgres instance? I would like to import data into the discourse database in bulk but have no idea how to connect to postgres or allow host clients (my machine) to connect via odbc or postgres drivers?
You shall never import direct into Discourse using the database.
You can use our API and write a script that reads from a database or spreadsheet and creates posts, topic or users on Discourse.
For read only use, you can use the Data Explorer plugin, or (in last case) open the port 5432 from the container to the outside world.