This demonstration shows both .sql
and .sh
files being used to initialize a database programatically. The commands used in the .sh
are not important, but they demonstrate the type of commands you might add to that file. The .sql
file shows some simple commands you might use to stand up your postgres db.
I've attached a pgadmin4 container to the compose stack. This is just for ease of use, it connects to the postgres db and displays a lot of useful information quickly. Feel free to remove if not wanted.
I've gone ahead and declared these important variables: