modified: .env
modified: README.md modified: compose.yml modified: configuration.py new file: haproxy.cfg new file: init-patroni-users.sql renamed: entrypoint.sh -> netbox-entrypoint.sh renamed: Containerfile -> netbox.Containerfile modified: nginx.conf new file: patroni-entrypoint.sh new file: patroni.Containerfile new file: patroni.yml
This commit is contained in:
1 parent
136ee48052
commit
e7b53b6965
12 files changed
+404
-41
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# /patroni-entrypoint.sh – Patroni container entrypoint
|
||||
# Ensures permissions then starts Patroni as the postgres user
|
||||
# ============================================================
|
||||
set -euo pipefail
|
||||
|
||||
DATA_DIR="${PATRONI_POSTGRESQL_DATA_DIR:-/var/lib/postgresql/data}"
|
||||
|
||||
# Ensure data and socket directories exist with correct ownership
|
||||
mkdir -p "$DATA_DIR" /var/run/postgresql
|
||||
chown -R postgres:postgres "$DATA_DIR" /var/run/postgresql
|
||||
# PostgreSQL requires data dir mode 0700 or 0750
|
||||
chmod 700 "$DATA_DIR"
|
||||
|
||||
# Ensure pgpass file is writable by postgres
|
||||
touch /tmp/pgpass
|
||||
chown postgres:postgres /tmp/pgpass
|
||||
chmod 600 /tmp/pgpass
|
||||
|
||||
# Start Patroni (manages PostgreSQL lifecycle) as postgres user
|
||||
exec su-exec postgres "$@"
|
||||
Reference in new issue
Block a user