Dockerfile to run postgres

For my application, I need postgres, hence using docker run, I installed pg and I’m able to work. Now I’m finding an option if those docker commands be part of a dockerfile so that when i bootrun the application, docker runs the postgres also at the background. Since I’m new to docker, not have enough idea on how to create dockerfile for postgres. Any advise is appreciated!

Thanks
sen

Hello Sen
You have a refer this Link


or direct install postgres database use of docker pull postgres
Default it take a stable latest version.