This commit is contained in:
Julien Goux committed 2025-05-19 16:00:30 +02:00
1 parent a55ad3a434
commit 49b7ecd32d
2 files changed
+31 -8

No files matched your search

+3 -8
View File
@@ -406,6 +406,8 @@ services:
- ./volumes/db/pooler.sql:/docker-entrypoint-initdb.d/migrations/99-pooler.sql:Z
# Use named volume to persist pgsodium decryption key between restarts
- db-config:/etc/postgresql-custom
# Start script
- ./volumes/db/start.sh:/start.sh:Z
healthcheck:
test:
[
@@ -432,14 +434,7 @@ services:
POSTGRES_DB: ${POSTGRES_DB}
JWT_SECRET: ${JWT_SECRET}
JWT_EXP: ${JWT_EXPIRY}
command:
[
"postgres",
"-c",
"config_file=/etc/postgresql/postgresql.conf",
"-c",
"log_min_messages=fatal" # prevents Realtime polling queries from appearing in logs
]
command: ["/bin/sh", "-c", "/start.sh"]
vector:
container_name: supabase-vector
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
echo "Starting PostgreSQL..."
# Start PostgreSQL as the postgres user
gosu postgres postgres -c config_file=/etc/postgresql/postgresql.conf -c log_min_messages=fatal &
PGPID=$!
# Wait for PostgreSQL to be ready
echo "Waiting for PostgreSQL to be ready..."
until pg_isready; do
echo "PostgreSQL not ready yet..."
# Check if PostgreSQL is still running
if ! kill -0 $PGPID 2>/dev/null; then
echo "PostgreSQL process died! Check the logs above for errors."
exit 1
fi
sleep 1
done
echo "PostgreSQL is ready!"
echo "Updating passwords..."
# Update passwords using roles.sql
psql -v ON_ERROR_STOP=1 -f /docker-entrypoint-initdb.d/init-scripts/99-roles.sql
# Wait for the PostgreSQL process
wait $PGPID