Check out example codes for "input sql file into docker postgres". It will help you in understanding the concepts better.

Code Example 1

docker container exec -i $(docker-compose ps -q postgres) psql exampledatabase < exampledata.sql

Learn ReactJs, React Native from akashmittal.com