It's not able to connect as there is nothing running on the Docker discourse container on port 5432 by default.
[root@plesk ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e559d908dfa7 bitnami/discourse "/app-entrypoint.s..." 7 minutes ago Up 8 seconds 0.0.0.0:32769->3000/tcp discourse
[root@plesk ~]# docker exec -it e559d908dfa7 bash
root@e559d908dfa7:/# lsof -i:5432
root@e559d908dfa7:/#