Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.29k
stars
520
forks
source link
How to overwrite ASPNETCORE_ENVIRONMENT when running in Docker? #1476
I have a bunch of appsetting json files for different environments, like for instance appsettings.local.json. I'm loading the environment specific file like this:
config.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", optional: false, reloadOnChange: true);
When running tye run this is fine, but using --docker seems to overwrite the env variable with "Development". I can see this in the logs as wel, where I can see -e "ASPNETCORE_ENVIRONMENT=Development" being passed on container initialization.
How can I set ASPNETCORE_ENVIRONMENT to the value I want?
I have a bunch of appsetting json files for different environments, like for instance appsettings.local.json. I'm loading the environment specific file like this:
config.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", optional: false, reloadOnChange: true);
In my yaml file I set
When running
tye run
this is fine, but using--docker
seems to overwrite the env variable with "Development". I can see this in the logs as wel, where I can see-e "ASPNETCORE_ENVIRONMENT=Development"
being passed on container initialization.How can I set ASPNETCORE_ENVIRONMENT to the value I want?