diff --git a/BotSharp.WebHost/Program.cs b/BotSharp.WebHost/Program.cs index 09362f52..23601a8c 100644 --- a/BotSharp.WebHost/Program.cs +++ b/BotSharp.WebHost/Program.cs @@ -18,10 +18,20 @@ namespace BotSharp.WebHost .ConfigureAppConfiguration((hostingContext, config) => { var env = hostingContext.HostingEnvironment; - string dir = Path.GetFullPath(env.ContentRootPath + "/.."); - var settings = Directory.GetFiles(Path.Combine(dir, "Settings"), "*.json"); + string dir = Path.GetFullPath(env.ContentRootPath); + string settingsFolder = Path.Combine(dir, "Settings"); + + if (!Directory.Exists(settingsFolder)) + { + dir = Path.GetFullPath(env.ContentRootPath + "/.."); + } + + settingsFolder = Path.Combine(dir, "Settings"); + Console.WriteLine($"Settings folder: {settingsFolder}"); + var settings = Directory.GetFiles(settingsFolder, "*.json"); settings.ToList().ForEach(setting => { + Console.WriteLine($"Read {setting}"); config.AddJsonFile(setting, optional: false, reloadOnChange: true); }); }) diff --git a/Dockerfile b/Dockerfile index 93fae0a5..9da2a29c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,15 +5,13 @@ WORKDIR /source # copies the rest of your code COPY . . RUN dotnet build -RUN dotnet publish --output /app/ --configuration Debug +RUN dotnet publish --output /app --configuration RASA -# install facebookresearch fasttext -RUN wget https://github.com/facebookresearch/fastText/archive/v0.1.0.zip -RUN apt-get update -RUN apt-get install -y unzip make g++ -RUN unzip v0.1.0.zip -WORKDIR /source/fastText-0.1.0/ -RUN make +# copy Settings folder +COPY Settings /app/Settings + +# App_Data +COPY BotSharp.WebHost/App_Data /app/App_Data # stage 2: run WORKDIR /app