commit 6483a81f2e19cbbc6c3423732b9f074801f8f212 Author: bvn13 Date: Sat Nov 9 18:18:50 2024 +0300 initial diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..6e0fee4 --- /dev/null +++ b/docker-compose.yaml @@ -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" +