3 ms·
I used Docker Compose to, among other things, manage Postgres, which wants to listen to port 5432 and use a central dir to hold databases. Can a non Docker solu
by aitchnyu 5y ago
I used Docker Compose to, among other things, manage Postgres, which wants to listen to port 5432 and use a central dir to hold databases. Can a non Docker solution allow me to run multiple instances of Postgres?
- Bayart 5y agoWithout going into stuff like Kubernetes, basically what you want is to run your postgres instances behind a load-balancer listening to 5432 and forwarding to whatever instance. The most common with postgres is probably HAProxy. If your problem is that you want to run unrelated instance of postgres... you don't really have a problem to begin with. Either use docker run to run your postgres image on different ports with different volumes, or just make a docker-compose YAML file with a bunch of postgres services. It's not like you have to have a single one.
- tempodox 5y agoDeploy them into different directories and have them listen on different ports. You can configure the deployment directory when building from source and then set the port numbers in the respective “postgresql.conf” files.
- mst 5y agoRight, a bunch of apps I've worked on use p3rl.org/Test::Postgresql58 to spin up a temporary postgres instance per test file - clean state and parallelisation are wonderful things to have for fast and reliable testing cycles.