You can interact with an running Postgres Instance in Docker with:
docker exec -it <container-name> psql -U postgres -d <db-anem>
Get the container name from docker ps
Creating a backup:
docker exec -it <container-name> pg_dump -U postgres my_database > backup.sql