Running local Postgres DB from Docker on a mac using docker
brew install psql
brew link --force libpq
if you use zsh..
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.zshrc
Edit the 'env.sh' file to set version, user, password etc. See https://hub.docker.com/_/postgres/ for more detail.
source ./env.sh
docker-compose up
psql -U postgres -h localhost
docker-compose down
docker container prune
docker network prune
docker image prune
docker volume prune
# or do this....
docker system prune --volumes