From 5e6c36c43c66b752dc0cdd9ef94ce9b89cf55b3f Mon Sep 17 00:00:00 2001 From: Paul Beaudoin Date: Mon, 22 Jul 2024 11:07:50 -0400 Subject: [PATCH] Override env vars set by stale task definitions --- lib/load-config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/load-config.js b/lib/load-config.js index 4db11668..10941372 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -13,8 +13,9 @@ module.exports.loadConfig = async () => { : 'production' const envPath = `config/${env}.env` - // Load env vars: - dotenv.config({ path: envPath }) + // Load env vars + // Override any env vars that are already set (e.g. by ECS task definition) + dotenv.config({ path: envPath, override: true }) // Now that we've loaded env vars, which may include LOG_LEVEL, instantiate logger: logger.setLevel(process.env.LOG_LEVEL)