Prod mode - when NODE_ENV=production, config/env/production is not being used

Hi Strapi Team!

I followed the official docs on using different environment varibles and etc: Environment variables | Strapi Documentation

i have config/env/production/database.js and I also have .env.production …whenever I try to run an app in production mode, the vars that I have in .env.production don’t override whatever I have in .env

I’ve even tried to point to env file as its mentioned in the docs:

ENV_PATH=.env.production npm run start

still nothing…i added a console logs in the register function of the src/index.ts file:

console.log(process.env.NODE_ENV)
console.log(strapi.config.database.connection)

and I still see development variables…am I missing something in the setup?

This topic has been created from a Discord post (1237175395896262656) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord