Last active
September 5, 2018 09:28
-
-
Save Dviejopomata/13c7d92077344331df09f2d4af11aefa to your computer and use it in GitHub Desktop.
Postgres master slave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
pg-master: | |
restart: always | |
image: sameersbn/postgresql:10 | |
volumes: | |
- pg-master:/var/lib/postgresql | |
ports: | |
- "5434:5432" | |
environment: | |
- DEBUG=false | |
- PG_PASSWORD=postgres | |
- DB_USER=dviejo | |
- DB_PASS=dviejo_password | |
- DB_NAME=dviejo | |
- DB_UNACCENT=false | |
- REPLICATION_MODE=master | |
- REPLICATION_USER=replicator | |
- REPLICATION_PASS=replpassword | |
- REPLICATION_SSLMODE= | |
pg-slave: | |
restart: always | |
image: sameersbn/postgresql:10 | |
volumes: | |
- pg-slave:/var/lib/postgresql | |
ports: | |
- "5435:5432" | |
links: | |
- pg-master:master | |
environment: | |
- DEBUG=false | |
- REPLICATION_MODE=slave | |
- REPLICATION_HOST=master | |
- REPLICATION_USER=replicator | |
- REPLICATION_PASS=replpassword | |
pgadmin: | |
image: dpage/pgadmin4:3.2 | |
ports: | |
- "5051:80" | |
environment: | |
- PGADMIN_DEFAULT_EMAIL=dviejo@gmail.com | |
- PGADMIN_DEFAULT_PASSWORD=123456 | |
links: | |
- pg-master | |
volumes: | |
pg-master: | |
driver: "local" | |
pg-slave: | |
driver: "local" | |
sessions: | |
driver: "local" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment