From 9f70160e89046896aecad43ff37a2d007e44323f Mon Sep 17 00:00:00 2001 From: Brian Bouterse Date: Wed, 22 Apr 2026 14:54:22 -0400 Subject: [PATCH] Fix dev container: chmod 700 PGDATA before initdb PostgreSQL's initdb requires the data directory to be mode 0700. The Containerfile sets it to 777 for OpenShift UID compatibility, but initdb refuses to run on a world-writable directory. The entrypoint now sets 700 before initdb runs. Co-Authored-By: Claude Opus 4.6 (1M context) --- build/dev-entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/dev-entrypoint.sh b/build/dev-entrypoint.sh index 686180b7..57c3045c 100755 --- a/build/dev-entrypoint.sh +++ b/build/dev-entrypoint.sh @@ -8,6 +8,8 @@ PGDATA=/var/lib/postgresql/data # is owned by the current UID, which is required by PostgreSQL and # varies on OpenShift (random UID assignment). if [ ! -f "$PGDATA/PG_VERSION" ]; then + # PostgreSQL requires the data directory to be mode 0700. + chmod 700 "$PGDATA" 2>/dev/null || true /usr/lib/postgresql/16/bin/initdb -D "$PGDATA" echo "host all all 0.0.0.0/0 trust" >> "$PGDATA/pg_hba.conf" echo "local all all trust" >> "$PGDATA/pg_hba.conf"