Make sure you don't have an instance postgres running locally. If you run psql postgres
and you can connect then that means postgres running already on your local, and when you run `psql -h localhost -U username -d dbname` you will be trying to connect to the local pg instance where the username and db you are running in the container do not exist.