Skip to content

Commit

Permalink
Server hub updates.
Browse files Browse the repository at this point in the history
.NET 8, update Prometheus and stuff, Dockerfile
  • Loading branch information
PJB3005 committed May 23, 2024
1 parent 987089f commit 1d98ccd
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*/bin/
*/obj/
.git/
.idea/
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* text=auto
* text=auto
build.sh text eol=lf
deploy.sh text eol=lf
8 changes: 4 additions & 4 deletions SS14.ServerHub/SS14.ServerHub.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -11,11 +11,11 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.2" />
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="2.1.0" />
<PackageReference Include="prometheus-net" Version="7.0.0" />
<PackageReference Include="prometheus-net.AspNetCore" Version="7.0.0" />
<PackageReference Include="prometheus-net" Version="8.2.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SS14.Web.Tests/SS14.Web.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions SS14.Web.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
LICENSE.txt = LICENSE.txt
README.md = README.md
hub.Dockerfile = hub.Dockerfile
deploy.sh = deploy.sh
build.sh = build.sh
.dockerignore = .dockerignore
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{569B190C-2FE6-44FA-B282-E0E7ACE64226}"
Expand Down
24 changes: 24 additions & 0 deletions hub.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
RUN mkdir /repo && chown $APP_UID /repo
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["SS14.ServerHub/SS14.ServerHub.csproj", "SS14.ServerHub/"]
RUN dotnet restore "SS14.ServerHub/SS14.ServerHub.csproj"
COPY . .
WORKDIR "/src/SS14.ServerHub"
RUN dotnet build "SS14.ServerHub.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "SS14.ServerHub.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "SS14.ServerHub.dll"]

0 comments on commit 1d98ccd

Please sign in to comment.