Fix dockerfile bug.

This commit is contained in:
Oceania2018 2018-09-13 16:52:19 -05:00
parent 0b09b20103
commit dfcfb1eaa4
2 changed files with 18 additions and 10 deletions

View file

@ -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);
});
})

View file

@ -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