This test was requested by Willian Nascimento.
Description available at https://gist.github.com/cloudwalk-tests/dfd459b26fd031acf986f1e15acad0d5 .
Put all project files in a folder/path where docker
and docker-compose
commands are available:
scripts
|- pg_master/db/migration
|- V1_init.sql
|- pg_replica/db/migration
|- V1_init.sql
|- db_version.sql
|- pg_execute.sh
|- pg_migration.sh
|- test_insert.sql
db_start.cmd
db_start.ksh
db_start.sh
db_stop.cmd
db_stop.ksh
db_stop.sh
docker-compose.yaml
For both pg_master
and pg_replica
database containers running on PostgreSQL v14 (could be using v16+ or more recent version) will used bind volume mounts.
It is recommended to use the scripts below to avoid database crashes.
If you are running Microsoft Windows, open the terminal or cmd.exe
, go to the folder where docker-compose.yaml
file is (the root of the project) using the command cd
.
To start both pg_master
and pg_replica
instances, just run
db_start.cmd
db_stop.cmd
On Unix the procedure is the same, just fire up a new terminal with bash, cd
to the root folder of the project where docker-compose.yaml
file is.
bash db_start.sh
bash db_stop.sh
I don't own any Apple device like a MacBook, but follow the Linux process and try these scripts below. They should work.
ksh db_start.ksh
ksh db_stop.ksh