You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m developing a .NET Web API project and planning to use Docker Compose to manage containerization. I have a few questions and would love to hear some advice or best practices from the community:
Comparison between appsettings.json and .env
appsettings.json is the built-in configuration method for .NET, while .env is often used for Docker or environment variable settings.
I’d like to understand the advantages of using appsettings.json in project development and deployment. Are there specific scenarios where it should be prioritized over .env?
Environment-specific appsettings.json management
When packaging the project into a Docker image, what is the recommended way to include only the relevant appsettings.json file (e.g., for Development or Production environments)?
I’m considering using build args or replacing the file through CI/CD pipelines. Would this be a reasonable approach, or is there a better method?
Looking forward to your insights and suggestions. Thanks in advance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone,
I’m developing a .NET Web API project and planning to use Docker Compose to manage containerization. I have a few questions and would love to hear some advice or best practices from the community:
Comparison between
appsettings.json
and.env
appsettings.json
is the built-in configuration method for .NET, while.env
is often used for Docker or environment variable settings.appsettings.json
in project development and deployment. Are there specific scenarios where it should be prioritized over.env
?Environment-specific
appsettings.json
managementappsettings.json
file (e.g., for Development or Production environments)?Looking forward to your insights and suggestions. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions