Autopilot Pattern Postgres
This repo serves as a blueprint demonstrating Postgres designed for automated operation using the Autopilot Pattern.
Environment Variables
CONSUL
: consul hostnameCONSUL_AGENT
: determines if the consul agent is executed in the containerDEBUG
: used to control the Node.jsdebug
moduleLOG_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
Example Usage
$ 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.
Modifying this Pattern
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.