If you want to see this repo without tests, only with Flyway, you can look at this version.
To run PostgreSQL in Docker and apply schema using flyway, you have to run:
./run_in_docker.sh
Press Ctrl+C when you no longer need db to run. To remove instance from your local machine run:
./destroy_docker_instance.sh
If you want to read more about Flyway schema migration in this repo, check this blog post.
If you want to read how I'm using pgTAP look at this blog post.
If you want to run tests in Docker, you have to build docker image first.
make build_test_image
Then you can run tests which are in tests directory.
make tests
For this repo I used other's work, you can find it here:
docker-library/postgres#306 (comment)
https://github.com/walm/docker-pgtap
https://medium.com/engineering-on-the-incline/unit-testing-postgres-with-pgtap-af09ec42795
pgTAP documentation https://pgtap.org/