This repo serves as a blueprint demonstrating Postgres designed for automated operation using the Autopilot Pattern.
CONSUL: consul hostnameCONSUL_AGENT: determines if the consul agent is executed in the containerDEBUG: used to control the Node.jsdebugmoduleLOG_LEVEL: control the amount of logging from ContainerPilotPGDATA: sets the location of the Postgres database filesPOSTGRES_DB: the name of the Postgres databasePOSTGRES_PASSWORD: the password used to access the Postgres databasePOSTGRES_USER: the username used to access the Postgres database
$ cd examples/compose
$ docker-compose up -d
$ docker-compose scale db=3
The first instance creates a Postgres master. All additional instances create read-only replicas.
This image extends the official postgres:9.6.4-alpine image. Postgres can be configured as needed by modifying etc/pg_hba.conf, etc/postgresql.conf.ctmpl, and etc/recovery.conf.ctmpl, and then rebuilding the image.