Add docker file
Changed kestrel bindings (Docker doesn't resolve loopback)
This commit is contained in:
2
LaDOSE.Src/.dockerignore
Normal file
2
LaDOSE.Src/.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
*/*/bin*
|
||||
*/*/obj*
|
||||
15
LaDOSE.Src/Dockerfile
Normal file
15
LaDOSE.Src/Dockerfile
Normal file
@@ -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"]
|
||||
|
||||
@@ -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<Startup>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user