update version and image docker

This commit is contained in:
Erik Pique 2019-07-23 10:26:33 +02:00
parent 1c5c0c11c4
commit 31f77cb79e
8 changed files with 21 additions and 28 deletions

View File

@ -205,7 +205,8 @@
ConfigureAuth(app); ConfigureAuth(app);
app.UseMvcWithDefaultRoute(); app.UseRouting();
app.UseEndpoints(e => e.MapDefaultControllerRoute());
app.UseSwagger() app.UseSwagger()
.UseSwaggerUI(c => .UseSwaggerUI(c =>

View File

@ -95,7 +95,8 @@
ConfigureAuth(app); ConfigureAuth(app);
app.UseMvcWithDefaultRoute(); app.UseRouting();
app.UseEndpoints(e => e.MapDefaultControllerRoute());
app.UseSwagger() app.UseSwagger()
.UseSwaggerUI(c => .UseSwaggerUI(c =>
@ -155,7 +156,7 @@
{ {
options.Filters.Add(typeof(HttpGlobalExceptionFilter)); options.Filters.Add(typeof(HttpGlobalExceptionFilter));
}) })
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2) .SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddControllersAsServices(); //Injecting Controllers themselves thru DI .AddControllersAsServices(); //Injecting Controllers themselves thru DI
//For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services //For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services

View File

@ -148,6 +148,7 @@ namespace Ordering.SignalrHub
app.UseAuthentication(); app.UseAuthentication();
app.UseRouting();
app.UseEndpoints(endpoints => app.UseEndpoints(endpoints =>
{ {
endpoints.MapHub<NotificationsHub>("/notificationhub", options => endpoints.MapHub<NotificationsHub>("/notificationhub", options =>

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src WORKDIR /src
COPY scripts scripts/ COPY scripts scripts/

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src WORKDIR /src
COPY scripts scripts/ COPY scripts scripts/

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src WORKDIR /src
COPY scripts scripts/ COPY scripts scripts/

View File

@ -54,7 +54,7 @@ namespace WebStatus
.UseSerilog() .UseSerilog()
.Build(); .Build();
private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration) private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
{ {
var seqServerUrl = configuration["Serilog:SeqServerUrl"]; var seqServerUrl = configuration["Serilog:SeqServerUrl"];
var logstashUrl = configuration["Serilog:LogstashgUrl"]; var logstashUrl = configuration["Serilog:LogstashgUrl"];

View File

@ -1,7 +1,4 @@
using HealthChecks.UI.Client; using Microsoft.AspNetCore.Builder;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.ServiceFabric;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@ -31,7 +28,7 @@ namespace WebStatus
.AddCheck("self", () => HealthCheckResult.Healthy()); .AddCheck("self", () => HealthCheckResult.Healthy());
services.AddHealthChecksUI(); services.AddHealthChecksUI();
services.AddMvc() services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0); .SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
} }
@ -64,20 +61,19 @@ namespace WebStatus
Predicate = r => r.Name.Contains("self") Predicate = r => r.Name.Contains("self")
}); });
app.UseHealthChecksUI(config => { app.UseHealthChecksUI(config =>
{
config.ResourcesPath = string.IsNullOrEmpty(pathBase) ? "/ui/resources" : $"{pathBase}/ui/resources"; config.ResourcesPath = string.IsNullOrEmpty(pathBase) ? "/ui/resources" : $"{pathBase}/ui/resources";
config.UIPath = "/hc-ui"; config.UIPath = "/hc-ui";
}); });
app.UseStaticFiles(); app.UseStaticFiles();
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseMvc(routes => app.UseEndpoints(endpoints =>
{ {
routes.MapRoute( endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
}); });
} }
@ -91,12 +87,6 @@ namespace WebStatus
// Enable K8s telemetry initializer // Enable K8s telemetry initializer
services.AddApplicationInsightsKubernetesEnricher(); services.AddApplicationInsightsKubernetesEnricher();
} }
if (orchestratorType?.ToUpper() == "SF")
{
// Enable SF telemetry initializer
services.AddSingleton<ITelemetryInitializer>((serviceProvider) =>
new FabricTelemetryInitializer());
}
} }
} }
} }