Upgrade to .net8

This commit is contained in:
Gervasio Marchand 2023-12-13 21:31:54 -03:00
parent 4ed3f24ff6
commit c5034a8e67
No known key found for this signature in database
GPG Key ID: B7736CB188DD0A38
5 changed files with 8 additions and 7 deletions

View File

@ -1,12 +1,12 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
ARG ARCH= ARG ARCH=
FROM mcr.microsoft.com/dotnet/sdk:6.0.411-alpine3.18-${ARCH} AS builder FROM mcr.microsoft.com/dotnet/sdk:8.0.100-1-alpine3.18-${ARCH} AS builder
WORKDIR /src WORKDIR /src
COPY src /src/ COPY src /src/
RUN dotnet publish -c Release /src/FakeRelay.sln -o /app RUN dotnet publish -c Release /src/FakeRelay.sln -o /app
FROM mcr.microsoft.com/dotnet/aspnet:6.0.19-alpine3.18-${ARCH} FROM mcr.microsoft.com/dotnet/aspnet:8.0.0-alpine3.18-${ARCH}
VOLUME ["/data"] VOLUME ["/data"]
ENV CONFIG_PATH=/data/config.json ENV CONFIG_PATH=/data/config.json
COPY --from=builder /app /app COPY --from=builder /app /app

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@ -5,11 +5,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="prometheus-net.AspNetCore" Version="7.0.0" /> <PackageReference Include="prometheus-net.AspNetCore" Version="8.2.0" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>

View File

@ -12,6 +12,7 @@ Config.Init(builder.Configuration.GetValue<string>("CONFIG_PATH"));
// Add services to the container. // Add services to the container.
builder.Services.AddControllersWithViews(); builder.Services.AddControllersWithViews();
builder.Services.AddHttpLogging(_ => { });
builder.Services.Configure<ForwardedHeadersOptions>(options => builder.Services.Configure<ForwardedHeadersOptions>(options =>
{ {