upgrade .NET to v6
This commit is contained in:
parent
e6d812fe6b
commit
084978d681
29
Dockerfile
29
Dockerfile
@ -1,19 +1,24 @@
|
|||||||
# Stage 1
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
|
||||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
WORKDIR /app
|
||||||
WORKDIR /build
|
EXPOSE 5000
|
||||||
COPY . .
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["ELT/ELT.csproj", "ELT/"]
|
||||||
|
|
||||||
COPY ./NuGet.Config /nuget.config
|
COPY ./NuGet.Config /nuget.config
|
||||||
COPY ./evoleasing_25.crt /etc/ssl/certs
|
COPY ./evoleasing_25.crt /etc/ssl/certs
|
||||||
RUN update-ca-certificates
|
RUN update-ca-certificates
|
||||||
|
|
||||||
RUN dotnet restore
|
RUN dotnet restore "ELT/ELT.csproj"
|
||||||
RUN dotnet publish -c Release -o /app
|
COPY . .
|
||||||
# Stage 2
|
WORKDIR "/src/ELT"
|
||||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS final
|
RUN dotnet build "ELT.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "ELT.csproj" -c Release -o /app/publish
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app .
|
COPY --from=publish /app/publish .
|
||||||
|
|
||||||
EXPOSE 5000
|
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "ELT.dll"]
|
ENTRYPOINT ["dotnet", "ELT.dll"]
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<LangVersion>default</LangVersion>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.0.7" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -22,9 +22,9 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": false,
|
"launchBrowser": false,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:2121"
|
"applicationUrl": "http://localhost:5000"
|
||||||
},
|
},
|
||||||
"Docker": {
|
"Docker": {
|
||||||
"commandName": "Docker",
|
"commandName": "Docker",
|
||||||
|
|||||||
@ -19,8 +19,6 @@ namespace ELT
|
|||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddControllers();
|
services.AddControllers();
|
||||||
|
|
||||||
services.AddSwaggerGen();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
@ -28,10 +26,6 @@ namespace ELT
|
|||||||
{
|
{
|
||||||
if (env.IsDevelopment()) app.UseDeveloperExceptionPage();
|
if (env.IsDevelopment()) app.UseDeveloperExceptionPage();
|
||||||
|
|
||||||
app.UseSwagger();
|
|
||||||
|
|
||||||
app.UseSwaggerUI();
|
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
|
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user