fix(deploy): sync DB password via ALTER USER depuis socket local postgres
All checks were successful
CI / Lint, Unit Tests & Build (push) Successful in 6m9s
CI / Deploy production (on server) (push) Successful in 24s

Le volume postgres a ete init avec un mot de passe different de .env.docker.
ALTER USER depuis l'interieur du conteneur (pas besoin d'auth sur socket local)
aligne le mot de passe DB avec POSTGRES_PASSWORD de .env.docker.
This commit is contained in:
Antigravity
2026-07-04 20:10:22 +00:00
parent 58fe5eb54f
commit f9d79365f3

View File

@@ -152,6 +152,13 @@ fi
wait_for_postgres || exit 1
# Sync DB password: postgres local socket doesn't need auth, so we can
# ALTER USER to match whatever POSTGRES_PASSWORD is in .env.docker.
# This fixes P1000 auth failures when the volume was initialized with a different password.
docker compose exec -T postgres psql -U "${POSTGRES_USER:-memento}" -d "${POSTGRES_DB:-memento}" -c \
"ALTER USER \"${POSTGRES_USER:-memento}\" WITH PASSWORD '${POSTGRES_PASSWORD:-memento}';" \
2>/dev/null && echo "DB password synced" || echo "WARN: could not sync DB password"
docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION IF NOT EXISTS vector;"' >/dev/null
if git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q '^memento-note/prisma/migrations/'; then