mirror of
https://github.com/Dvorinka/Trackeep.git
synced 2026-06-03 20:12:58 +00:00
fix(docker): ensure correct permissions for PostgreSQL directories
Ensure that PGDATA, /run/postgresql, and /var/log/postgresql are owned by the postgres user to prevent volume permission issues during container startup.
This commit is contained in:
@@ -20,6 +20,10 @@ fi
|
||||
DB_USER=${DB_USER:-trackeep}
|
||||
DB_NAME=${DB_NAME:-trackeep}
|
||||
|
||||
# Ensure PostgreSQL directories are owned by postgres (fixes volume permission issues)
|
||||
mkdir -p "$PGDATA" /run/postgresql /var/log/postgresql
|
||||
chown -R postgres:postgres "$PGDATA" /run/postgresql /var/log/postgresql
|
||||
|
||||
# Initialize PostgreSQL if data directory is empty
|
||||
if [ ! -f "$PGDATA/PG_VERSION" ]; then
|
||||
echo "Initializing PostgreSQL database cluster..."
|
||||
|
||||
Reference in New Issue
Block a user