PostgreSQL DB with Docker and Vagrant

I’ve installed ChirpStack v4 (docker) on a Debian 11 vagrant box. All installation and configuration steps go fine.

On startup (docker-compose up), I receive the following:

docker-compose startup error:

chirpstack-docker-chirpstack-1                       | Error: Setup PostgreSQL connection pool error
chirpstack-docker-chirpstack-1                       |
chirpstack-docker-chirpstack-1                       | Caused by:
chirpstack-docker-chirpstack-1                       |     timed out waiting for connection: could not connect to server: Connection refused
chirpstack-docker-chirpstack-1                       |          Is the server running on host "localhost" (127.0.0.1) and accepting
chirpstack-docker-chirpstack-1                       |          TCP/IP connections on port 5432?
chirpstack-docker-chirpstack-1                       |     could not connect to server: Cannot assign requested address
chirpstack-docker-chirpstack-1                       |          Is the server running on host "localhost" (::1) and accepting
chirpstack-docker-chirpstack-1                       |          TCP/IP connections on port 5432?

In the chirpstack.toml file, I’m using localhost for the hostname:
dsn="postgres://chirpstack:chirpstack@localhost/chirpstack?sslmode=disable"

I’ve mapped port 5432 from the vagrant box to the host.
I’ve added

    host all all 0.0.0.0/0 md5
    host all all all trust

to pg_hba.conf
and I’ve added
listen_addresses = ‘*’
to postgresql.conf

I’ve also tried using the 127.0.0.1 and the eht0: IP address of the vagrant box for the postgres dsn connection string.

I’m clearly missing something and out of things to try. Can you assist?
Thanks & regards