wip
This commit is contained in:
29
entrypoint.sh
Executable file
29
entrypoint.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
_main() {
|
||||
|
||||
export REPLICATOR_USER="${REPLICATOR_USER:-q_replicator}"
|
||||
export REPLICATOR_PASSWORD="${REPLICATOR_PASSWORD:-josua5}"
|
||||
|
||||
echo "CREATE ROLE ${REPLICATOR_USER} REPLICATION LOGIN ENCRYPTED PASSWORD '${REPLICATOR_PASSWORD}';" > /docker-entrypoint-initdb.d/create_replicator.sql
|
||||
|
||||
mkdir -p
|
||||
REPLICATION_SLOTS=$((5 + 2 * ${SECONDARIES:-1}))
|
||||
{
|
||||
echo "wal_level = ${WAL_LEVEL:-replica}"
|
||||
echo "wal_log_hints = ${WAL_LOG_HINTS:-on}"
|
||||
echo "max_wal_size = ${MAX_WAL_SIZE:-1GB}"
|
||||
echo "min_wal_size = ${MIN_WAL_SIZE:-80MB}"
|
||||
echo "max_wal_senders = $REPLICATION_SLOTS"
|
||||
echo "max_replication_slots = $REPLICATION_SLOTS"
|
||||
echo "wal_keep_size = ${WAL_KEEP_SIZE:-1GB}"
|
||||
echo "restore_command = '${RESTORE_COMMAND:-cp /archive/%f %p}'"
|
||||
echo "archive_mode = ${ARCHIVE_MODE:-on}"
|
||||
echo "archive_command = '${ARCHIVE_COMMAND:-test ! -f /archive/%f && cp %p /archive/%f}'"
|
||||
} > /config/primary.conf
|
||||
|
||||
docker-entrypoint.sh "$@"
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
Reference in New Issue
Block a user