From 6483a81f2e19cbbc6c3423732b9f074801f8f212 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Sat, 9 Nov 2024 18:18:50 +0300 Subject: [PATCH] initial --- README.md | 0 docker-compose.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 README.md create mode 100644 docker-compose.yaml 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" +