A set of command-line BASH scripts to build, run, stop, or remove a Postgresql server and database in a docker container. [1].
On Mac and Windows users, do easy install of Docker Desktop for Mac or Windows, Docker Compose is included as part of those desktop installs.
Instructions are at https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
Instructions are at https://docs.docker.com/compose/install/#install-compose
- Clone or Download this repo to an empty local folder of your choosing.
- From the terminal cd into the newly created folder
- Make the Start, Stop, and Remove scripts executable.
sudo chmod +x Start.sh Stop.sh Remove.sh
- Create a database server ... and connect to database, (Create and connect to new database if it does not exist):
./Start.sh
- Stop the database instance and close database connection (SAFE: data will be persisted across complete machine restarts)
./Stop.sh
- Remove the datafile permanently (the database will be completely removed)
./Remove.sh
Even if you remove the database, ... a re-run of ./Start.sh will reconstruct the database to it's initial state.