Compare commits
8 Commits
9c80ad14f3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 48a1d6f984 | |||
| 79090e91d6 | |||
| 7d2d27c609 | |||
| c32f3596ec | |||
| 1fd587634b | |||
| 4c17c375ae | |||
| bf38c7dc1a | |||
| afb2102702 |
30
.dockerignore
Normal file
30
.dockerignore
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
**/.classpath
|
||||||
|
**/.dockerignore
|
||||||
|
**/.env
|
||||||
|
**/.git
|
||||||
|
**/.gitignore
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.toolstarget
|
||||||
|
**/.vs
|
||||||
|
**/.vscode
|
||||||
|
**/*.*proj.user
|
||||||
|
**/*.dbmdl
|
||||||
|
**/*.jfm
|
||||||
|
**/azds.yaml
|
||||||
|
**/bin
|
||||||
|
**/charts
|
||||||
|
**/docker-compose*
|
||||||
|
**/Dockerfile*
|
||||||
|
**/node_modules
|
||||||
|
**/npm-debug.log
|
||||||
|
**/obj
|
||||||
|
**/secrets.dev.yaml
|
||||||
|
**/values.dev.yaml
|
||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
|
!**/.gitignore
|
||||||
|
!.git/HEAD
|
||||||
|
!.git/config
|
||||||
|
!.git/packed-refs
|
||||||
|
!.git/refs/heads/**
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using AS1024.CommunityDocumentationPage.Interfaces;
|
using AS1024.CommunityDocumentationPage.Interfaces;
|
||||||
using AS1024.CommunityDocumentationPage.Models;
|
using AS1024.CommunityDocumentationPage.Models;
|
||||||
using Newtonsoft.Json;
|
using System.Text.Json;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
|
|
||||||
namespace AS1024.CommunityDocumentationPage.DIScopes
|
namespace AS1024.CommunityDocumentationPage.DIScopes
|
||||||
@@ -23,7 +23,9 @@ namespace AS1024.CommunityDocumentationPage.DIScopes
|
|||||||
HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI());
|
HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI());
|
||||||
string stringResult = await result.Content.ReadAsStringAsync();
|
string stringResult = await result.Content.ReadAsStringAsync();
|
||||||
var temp =
|
var temp =
|
||||||
JsonConvert.DeserializeObject<RouteTargets>(stringResult);
|
JsonSerializer.Deserialize<RouteTargets>(stringResult, new JsonSerializerOptions{
|
||||||
|
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
|
||||||
|
});
|
||||||
|
|
||||||
foreach (var route in temp.Results)
|
foreach (var route in temp.Results)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using AS1024.CommunityDocumentationPage.Interfaces;
|
using AS1024.CommunityDocumentationPage.Interfaces;
|
||||||
using AS1024.CommunityDocumentationPage.Models;
|
using AS1024.CommunityDocumentationPage.Models;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace AS1024.CommunityDocumentationPage.DIScopes
|
namespace AS1024.CommunityDocumentationPage.DIScopes
|
||||||
{
|
{
|
||||||
@@ -25,7 +23,8 @@ namespace AS1024.CommunityDocumentationPage.DIScopes
|
|||||||
HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI());
|
HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI());
|
||||||
string stringResult = await result.Content.ReadAsStringAsync();
|
string stringResult = await result.Content.ReadAsStringAsync();
|
||||||
#pragma warning disable CS8603 // Possible null reference return.
|
#pragma warning disable CS8603 // Possible null reference return.
|
||||||
return JsonConvert.DeserializeObject<RouteTargets>(stringResult);
|
return JsonSerializer.Deserialize<RouteTargets>(stringResult,
|
||||||
|
new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower });
|
||||||
#pragma warning restore CS8603 // Possible null reference return.
|
#pragma warning restore CS8603 // Possible null reference return.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
26
AS1024.CommunityDocumentationPage/Dockerfile
Normal file
26
AS1024.CommunityDocumentationPage/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||||
|
USER app
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
ARG TARGETARCH
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["AS1024.CommunityDocumentationPage/AS1024.CommunityDocumentationPage.csproj", "AS1024.CommunityDocumentationPage/"]
|
||||||
|
RUN dotnet restore "./AS1024.CommunityDocumentationPage/./AS1024.CommunityDocumentationPage.csproj" -a $TARGETARCH
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/AS1024.CommunityDocumentationPage"
|
||||||
|
RUN dotnet build "./AS1024.CommunityDocumentationPage.csproj" -c $BUILD_CONFIGURATION -o /app/build -a $TARGETARCH
|
||||||
|
|
||||||
|
FROM --platform=$BUILDPLATFORM build AS publish
|
||||||
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN dotnet publish "./AS1024.CommunityDocumentationPage.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false -a $TARGETARCH
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "AS1024.CommunityDocumentationPage.dll"]
|
||||||
@@ -1,20 +1,12 @@
|
|||||||
{
|
{
|
||||||
"iisSettings": {
|
|
||||||
"windowsAuthentication": false,
|
|
||||||
"anonymousAuthentication": true,
|
|
||||||
"iisExpress": {
|
|
||||||
"applicationUrl": "http://localhost:49374",
|
|
||||||
"sslPort": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"AS1024.CommunityDocumentationPage": {
|
"AS1024.CommunityDocumentationPage": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"applicationUrl": "http://localhost:5224",
|
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
},
|
||||||
|
"applicationUrl": "http://localhost:5224"
|
||||||
},
|
},
|
||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
@@ -22,6 +14,23 @@
|
|||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Docker": {
|
||||||
|
"commandName": "Docker",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_HTTP_PORTS": "8080"
|
||||||
|
},
|
||||||
|
"publishAllPorts": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:49374",
|
||||||
|
"sslPort": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user