Skip to content

Commit

Permalink
Override env vars set by stale task definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
nonword committed Jul 22, 2024
1 parent 6fddf67 commit 5e6c36c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/load-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5e6c36c

Please sign in to comment.