Is it possible to login into the postgres database inside the docker image?

If you’re following the standard Docker install and did not change the postgres template, try

./launcher enter app
su postgres -c "psql discourse"