If it's just for local development, I would use the same postgres instance for both databases. It looks like your trying to connect to the postgres on localhost (::1) but should probably be using the name of the service (postgres, or whatever you named it in the compose file).