adds docker-compose-replication.yml
This commit is contained in:
parent
1240c38816
commit
605fb0c80e
|
|
@ -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
|
||||
Loading…
Reference in New Issue