Error: getaddrinfo ENOTFOUND ${db.HOSTNAME}

I’m deploying Strapi on Digital Ocean App platform. Strapi builds correctly, but I get an error on the deploy phase:

Error: getaddrinfo ENOTFOUND ${db.HOSTNAME}

I have a database.js for production at config/env/production containing the following code

module.exports = ({ env }) => ({
connection: {
client: ‘postgres’,
connection: {
host: env(‘DATABASE_HOST’, ‘’),
port:‘DATABASE_PORT’, 5432),
database: env(‘DATABASE_NAME’, ‘neekplatform’),
user: env(‘DATABASE_USERNAME’, ‘webdev’),
password: env(‘DATABASE_PASSWORD’, ‘Development’),
ca: env(‘DATABASE_CA’)
debug: false,

Environment variables are set in the app settings in Digital Ocean.

I’ve got the exact same error. Anyone with a solution?

im dealing with the same thing. i went ahead and hardcoded the database values and it worked after that. but im still getting other issues so i cant say it worked 100%

this might be the answer!