This commit is contained in:
bvn13 2024-11-09 18:18:50 +03:00
commit 6483a81f2e
2 changed files with 41 additions and 0 deletions

0
README.md Normal file
View File

41
docker-compose.yaml Normal file
View File

@ -0,0 +1,41 @@
networks:
pg-replication:
driver: bridge
services:
pg-1:
image: 'bitnami/postgresql:14'
container_name: pg-repl-master
environment:
POSTGRESQL_USER: pguser
POSTGRESQL_PASSWORD: 1234
POSTGRESQL_REPLICATION_MODE: master
POSTGRESQL_REPLICATION_USER: repuser
POSTGRESQL_REPLICATION_PASSWORD: repuserpass
POSTGRESQL_WAL_LEVEL: replica
volumes:
- ./pg-1:/bitnami/postgresql:Z
networks:
- pg-replication
ports:
- "15432:5432"
pg-2:
image: 'bitnami/postgresql:14'
container_name: pg-repl-slave
environment:
POSTGRESQL_USER: pguser
POSTGRESQL_PASSWORD: 1234
POSTGRESQL_MASTER_HOST: pg-repl-master
POSTGRESQL_REPLICATION_MODE: slave
POSTGRESQL_REPLICATION_USER: repuser
POSTGRESQL_REPLICATION_PASSWORD: repuserpass
POSTGRESQL_WAL_LEVEL: replica
volumes:
- ./pg-2:/bitnami/postgresql:Z
networks:
- pg-replication
ports:
- "25432:5432"