liveBook · Manning

Node-config

As explained in Learn Docker in a Month of Lunches, Second Edition

node-config is a Node.js configuration library that loads settings from hierarchical files and environment variables with override precedence.

node-config lets a Node.js application load settings from multiple file locations and override them with environment variables. A practical container setup packages defaults in config and supplies environment-specific changes through config-override. section 18.1

Organize settings by the kind of change they represent:

  • Release-level settings stay the same for every environment in a release. section 18.1
  • Environment-level settings distinguish test, development, production, and other deployment environments. section 18.1
  • Feature-level settings switch behavior between releases, such as enabling or disabling metrics. section 18.1

Override a container's configuration

Run one container with image defaults, then mount config/dev as /app/config-override for a development configuration. Query each container's /config endpoint to compare settings. Add APP_METRICS_ENABLED=true to override one feature through the environment.

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains configuration categories, file locations, mounting, environment overrides, and endpoint verification without detailing library internals.
Examples
Uses an access-log container, config/dev volume, /config endpoint, and APP_METRICS_ENABLED environment variable.
What it assumes
Assumes basic Node.js and Docker usage while introducing configuration categories and layered deployment settings.
What you can do after
Operate/configure node-config deployments by mounting overrides, setting environment variables, and checking resolved configuration.
How it connects
Connects configuration management with Node.js, Docker volumes, environment variables, secrets, and feature flags.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.