Instead of creating the postgres container via commands, it might be worth considering using [testcontainers](https://testcontainers.com)?