Docker Postgres for development environment
brew install libpq
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
gem install pg -v '0.21.0' --without-pg
docker-compose up
To run daemonized
docker-compose up -d
To stop daemon
docker-compose postgres stop
docker exec -it postgres psql -h postgres -U pguser
It still an alpine machine
docker exec -it postgres bash
alias postgres_start="docker-compose -f ~/projects/postgres/docker-compose.yml up -d"
alias postgres_stop="docker-compose -f ~/projects/postgres/docker-compose.yml stop"
alias psql="docker exec -it postgres psql -h postgres -U pguser"
docker-compose exec -it postgres pg_dumpall -U pguser > pgdump
docker exec -i postgres psql -U pguser < pgdump