next.js
dcb536d0 - docs: standalone env file precedence and with-docker-multi-env secrets (#101728)

Commit
1 day ago
docs: standalone env file precedence and with-docker-multi-env secrets (#101728) Stacked on #101699. ## Summary - Standalone env files docs: runtime environment variables take precedence over the copied `.env` and `.env.production`, and unset variables fall back to them. Values from `.env.local` reach build-time work only. Secrets should be provided at runtime, as the `with-docker` example does. Deleting the copied files also removes their fallback values. Also corrects how the `'next-server'` exclude key is matched. - `with-docker-multi-env`: the `.sample` files are copied to `.env.production` and ship in the image. The example now keeps local env files out of the build context, explains that the `.sample` files must hold public values only, passes `API_SECRET` at runtime through `compose.yaml` (with `pages/api/secret.js` reporting whether it is set), and fixes dead docs links. ## Commits - docs: describe standalone env file precedence and runtime secrets - examples: keep secrets out of with-docker-multi-env images ## Follow-up - Environment variables guide: say that `.env` files are for local development, and that production secrets come from the deployment environment or a secret store. <!-- NEXT_JS_LLM -->
Author
Parents
Loading