adds docker-compose-replication.yml

This commit is contained in:
Sameer Naik 2016-11-07 17:41:59 +05:30
parent 1240c38816
commit 605fb0c80e
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
version: '2'
services:
postgresql-master:
image: 'bitnami/postgresql:latest'
ports:
- '5432'
volumes:
- 'postgresql_master_data:/bitnami/postgresql'
environment:
- POSTGRESQL_REPLICATION_MODE=master
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_USERNAME=my_user
- POSTGRESQL_PASSWORD=my_password
- POSTGRESQL_DATABASE=my_database
postgresql-slave:
image: 'bitnami/postgresql:latest'
ports:
- '5432'
depends_on:
- postgresql-master
environment:
- POSTGRESQL_REPLICATION_MODE=slave
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_MASTER_HOST=postgresql-master
- POSTGRESQL_MASTER_PORT=5432
volumes:
postgresql_master_data:
driver: local