diff --git a/LaDOSE.Src/.dockerignore b/LaDOSE.Src/.dockerignore new file mode 100644 index 0000000..92316b4 --- /dev/null +++ b/LaDOSE.Src/.dockerignore @@ -0,0 +1,2 @@ +*/*/bin* +*/*/obj* diff --git a/LaDOSE.Src/Dockerfile b/LaDOSE.Src/Dockerfile new file mode 100644 index 0000000..62cbb10 --- /dev/null +++ b/LaDOSE.Src/Dockerfile @@ -0,0 +1,15 @@ +FROM microsoft/dotnet:sdk AS build-env +WORKDIR /app + +# Copy everything else and build +COPY . ./ + +RUN dotnet publish LaDOSE.linux.sln -c Release -o out + +# Build runtime image +FROM microsoft/dotnet:aspnetcore-runtime +WORKDIR /app +COPY --from=build-env /app/LaDOSE.Api/out/ . +EXPOSE 5000 +ENTRYPOINT ["dotnet", "LaDOSE.Api.dll"] + diff --git a/LaDOSE.Src/LaDOSE.Api/Program.cs b/LaDOSE.Src/LaDOSE.Api/Program.cs index fb75431..5de33ec 100644 --- a/LaDOSE.Src/LaDOSE.Api/Program.cs +++ b/LaDOSE.Src/LaDOSE.Api/Program.cs @@ -37,7 +37,7 @@ namespace LaDOSE.Api return WebHost.CreateDefaultBuilder(args) .UseContentRoot(Directory.GetCurrentDirectory()) .UseConfiguration(config) - .UseKestrel(options => options.Listen(IPAddress.Loopback,int.Parse(config["Port"]))) + .UseKestrel(options => options.Listen(IPAddress.Any,int.Parse(config["Port"]))) .UseStartup(); } }