Skip to content

How to load env on production #12748

Answered by brunnerh
karchung0930 asked this question in Q&A
Discussion options

You must be logged in to vote
  1. It does not load .env files at runtime.
    If you only used $env/static/*, those are built directly into the output code and thus don't need to be loaded but also cannot be changed later.
  2. PM2 supports env variables in a config file.
    If you don't want to use that, there also is a --node-args option, so you can add --node-args="-r dotenv/config".

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by karchung0930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants