From ee087e33c7f1dc49ce6d4ef4e5b3c064080e7940 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 17 May 2025 17:12:22 +0800 Subject: [PATCH] . --- supabase/postgres/supervisord.conf | 3 ++- supabase/postgres/wrapper.sh | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/supabase/postgres/supervisord.conf b/supabase/postgres/supervisord.conf index 16cb18d..062676f 100644 --- a/supabase/postgres/supervisord.conf +++ b/supabase/postgres/supervisord.conf @@ -21,7 +21,8 @@ user=root autorestart=true stdout_logfile=/var/log/postgres.out.log stderr_logfile=/var/log/postgres.err.log -environment=POSTGRES_PASSWORD="postgres" +environment=POSTGRES_PASSWORD="postgres",POSTGRES_USER="supabase_admin",POSTGRES_DB="postgres",PGDATA="/var/lib/postgresql/data" + [program:postgrest] diff --git a/supabase/postgres/wrapper.sh b/supabase/postgres/wrapper.sh index 1c6d72f..0a3d1e2 100644 --- a/supabase/postgres/wrapper.sh +++ b/supabase/postgres/wrapper.sh @@ -1,4 +1,10 @@ #!/bin/bash set -e -exec /usr/local/bin/docker-entrypoint.sh postgres -D /etc/postgresql \ No newline at end of file +# 设置 PostgreSQL 初始化关键变量(如果没从环境变量中设定) +export POSTGRES_USER="${POSTGRES_USER:=supabase_admin}" +export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:=postgres}" +export POSTGRES_DB="${POSTGRES_DB:=postgres}" +export PGDATA="${PGDATA:=/var/lib/postgresql/data}" + +exec /usr/local/bin/docker-entrypoint.sh postgres -D "$PGDATA" \ No newline at end of file