cambios en postgress, no me esta gustando el problema de autenticacion
Some checks failed
build-and-deploy / build-and-deploy (push) Failing after 1m6s

This commit is contained in:
2025-11-22 00:04:30 -06:00
parent 12da05bfe7
commit 712412f944
3 changed files with 29 additions and 1 deletions

View File

@@ -46,6 +46,13 @@ jobs:
docker compose --project-name $APP_NAME down
docker compose --project-name $APP_NAME up -d --remove-orphans --wait
# Asegurar autenticación md5 y que la contraseña coincide con la env (cura volúmenes viejos)
echo "🔐 Sincronizando autenticación PostgreSQL (md5 + password)..."
ESCAPED_PASSWORD=${POSTGRES_PASSWORD//\'/\'\"\'\"\'}
docker exec -u postgres $APP_NAME-postgres psql -d $POSTGRES_DB -c "ALTER SYSTEM SET password_encryption = 'md5';"
docker exec -u postgres $APP_NAME-postgres psql -d $POSTGRES_DB -c "ALTER ROLE \"$POSTGRES_USER\" WITH PASSWORD '${ESCAPED_PASSWORD}';"
docker exec -u postgres $APP_NAME-postgres psql -d $POSTGRES_DB -c "SELECT pg_reload_conf();"
# Inicializar base de datos si es necesario
echo "🗄️ Inicializando base de datos..."
# Verificar si las tablas existen