Deploying n8n using a JPS manifest, the DB host variable remains unset as the PostgreSQL container is created later. I attempted:
DB_HOST: ${dbList[0].ip_value}
DB_HOST: ${dbList.getFirst().ip_value}
DB_HOST: ${dbList.primary_ip}
How can the IP be updated afterward?
hey, you might need to trigger a post deploy update hook to reset the env variable with the ip after the db is up, instead of relying on the initial manifest config. also check if your platfrm supports dynamic var updates.
Based on my experience managing similar setups, I encountered the timing challenge of independent container deployment, which required an alternative approach to static variable initialization. I implemented a script that waited for the PostgreSQL container to be fully operational before making updates to the environment. This script was triggered via the platform’s API and effectively updated the DB host even though it was not set during the initial manifest configuration. This method also allowed me to monitor any changes dynamically, ensuring that the DB host variable remains accurate once the container’s IP becomes available.