I'm working with docker for the first time and I'm trying to figure it all out.
In this project I'm working with we make extensive use of Windows environment variables for use in our startup file. And to put these in our Configuration we use the AddEnvironmentVariables(string prefix) method like so:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder =>
{
builder.AddEnvironmentVariables(prefix: "MICROSVC_")
.AddJsonFile("appsettings.json");
})
.UseStartup<Startup>();
In localhost and Azure this is no problem since we've added them to those environments. But I can not for the love of god figure out how to configure these environment variables in my docker container. I've seen that you could do it with -e in the run command but that would be just too much variables to pass through like that.