Restore Postgres database in docker

I have a rails app running inside docker containers and I would like to play around with production data locally. However I’m having trouble getting pg_restore to connect to the database.

There is a bit more detail on this stackoverflow question: postgresql - pg_restore to postgres running in docker container - Stack Overflow

Does anyone here have experience with this?