Skip to content

add optional read-replica database to docker compose#31

Open
spatel033 wants to merge 1 commit intomainfrom
add-db-read-replica
Open

add optional read-replica database to docker compose#31
spatel033 wants to merge 1 commit intomainfrom
add-db-read-replica

Conversation

@spatel033
Copy link

Updated docker-compose.yml: The main db service to prepare it for replication. It now starts with the required Postgres flags (wal_level=replica) and mounts the new init-replication.sh script.

Added init-replication.sh: Helper script to run inside the main db container on startup and add a security rule to pg_hba.conf. This rule is necessary to give the new replica permission to connect and clone the database.

Added docker-compose.replica.yml: New docker compose file defines the new db-replica service, which clones the primary database and keeps itself in sync.

Updated `docker-compose.yml`: The main db service to prepare it for replication. It now starts with the required Postgres flags (`wal_level=replica`) and mounts the new `init-replication.sh` script.
Added `init-replication.sh`: Helper script to run inside the main db container on startup and add a security rule to `pg_hba.conf`. This rule is necessary to give the new replica permission to connect and clone the database.
Added `docker-compose.replica.yml`: New docker compose file defines the new `db-replica` service, which clones the primary database and keeps itself in sync.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant