GitLab Docker access postgres instance

Hi! I installed GitLab using Docker image as stated here https://docs.gitlab.com/omnibus/docker/

Now Inside the docker instance with

sudo docker exec -i -t gitlab /bin/bash

How can I access the postgresql instance using psql client?

I tried this with no luck

psql -h localhost -U gitlab -p 5432

Thanks!

This should help you:

sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h "/var/opt/gitlab/postgresql" -d gitlabhq_production

The server is listen on a socket.