This script will create a stateful Postgres instance.
PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
1
2
3
4
5
6
7
8
#!/bin/bash
docker run -d --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword \
-p 5432:5432 \
-v ${PWD}/postgresql:/etc/postgresql \
-v ${PWD}/postgresql-common:/etc/postgresql-common \
-v ${PWD}/data:/var/lib/postgresql/data \
postgres