.NET Core reloadOnChange settings in container

I have a simple .net core console app that just prints in screen a string that reads from the settings

private static void Main(string[] args)
{
    var builder = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("Settings/appsettings.json", optional: true, reloadOnChange: true);
    var configuration = builder.Build();

    while (true)
    {
        var greeting = configuration.GetSection("MySettings").GetSection("Greeting").Value;
        Console.WriteLine(greeting);
    }        
}

When I run it locally the reloadOnChange works fine and I get the change in the string seamlessly.

So now I was trying to run it within a containe, for which I added a simple dockerfile

FROM microsoft/dotnet:2.1-sdk
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore

COPY . ./
RUN dotnet publish -c Release -o out
ENTRYPOINT ["dotnet", "out/DynamicConfig.dll"]

And tried to test that if I mounted the local appsettings file I would get that reloadOnChange behaviour, initially I tried to mount just the file but after reading some potential issues (although I think they could be overcome) decided to move it under that Settings folder. Yet, I don’t get it to change

The command that I use to run it is

docker run -it –rm -v /${PWD}/Settings:/app/Settings myimage

It has a slight different syntax for the usage in a Windows machine (and have even tried to map to /app/out/Settings with no luck neither)

Would love to hear something around the reasons this doesn’t “work”

Thanks

Source: StackOverflow