Sensitive configuration information, such as database account and password, is not suitable to be submitted with the code. So. Env is used, put locally, and. Env is deleted by git ignore, so it won't be submitted to the code warehouse.
The executable program that can be built still depends on the. Env file in the local relative directory when it is running. It will still need to read the configuration information from it, otherwise it will report an error.
In other words, the configuration information is localized, but the localized information is not packaged into the final executable program.
How can we do both at the same time? The desired effect is that the database configuration is not submitted for storage, and each developer has a local configuration file. However, according to the local configuration of each developer, the packaged executable program should also be internally "bound" with its corresponding configuration to generate different executable programs, which are no longer dependent on other external configurations.