diff --git a/Dockerfile b/Dockerfile index f6ef7bf..1532811 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["SS14.MapServer/SS14.MapServer.csproj", "SS14.MapServer/"] RUN dotnet restore "SS14.MapServer/SS14.MapServer.csproj" diff --git a/SS14.MapServer.Tests/SS14.MapServer.Tests.csproj b/SS14.MapServer.Tests/SS14.MapServer.Tests.csproj index 93a14a2..566ec62 100644 --- a/SS14.MapServer.Tests/SS14.MapServer.Tests.csproj +++ b/SS14.MapServer.Tests/SS14.MapServer.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable @@ -10,10 +10,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SS14.MapServer/MapProcessing/Services/ImageProcessingService.cs b/SS14.MapServer/MapProcessing/Services/ImageProcessingService.cs index e5d67b9..b1e6fed 100644 --- a/SS14.MapServer/MapProcessing/Services/ImageProcessingService.cs +++ b/SS14.MapServer/MapProcessing/Services/ImageProcessingService.cs @@ -1,4 +1,6 @@ -using SixLabors.ImageSharp.Advanced; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Advanced; +using SixLabors.ImageSharp.Processing; using SS14.MapServer.Models.Entities; namespace SS14.MapServer.MapProcessing.Services; diff --git a/SS14.MapServer/Program.cs b/SS14.MapServer/Program.cs index 9e83eae..aa06237 100644 --- a/SS14.MapServer/Program.cs +++ b/SS14.MapServer/Program.cs @@ -3,7 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.OpenApi.Models; +using Npgsql; using Quartz; +using Quartz.AspNetCore; using Serilog; using SS14.GithubApiHelper.Extensions; using SS14.GithubApiHelper.Services; @@ -58,7 +60,13 @@ builder.Services.AddApiRateLimiting(serverConfiguration); //DB -builder.Services.AddDbContext(opt => opt.UseNpgsql(builder.Configuration.GetConnectionString("default"))); +var dataSourceBuilder = new NpgsqlDataSourceBuilder(builder.Configuration.GetConnectionString("default")); +dataSourceBuilder.EnableDynamicJson(); +await using var dataSource = dataSourceBuilder.Build(); +builder.Services.AddDbContext(opt => +{ + opt.UseNpgsql(dataSource); +}); //Services builder.Services.AddScoped(); diff --git a/SS14.MapServer/SS14.MapServer.csproj b/SS14.MapServer/SS14.MapServer.csproj index 6256682..681245e 100644 --- a/SS14.MapServer/SS14.MapServer.csproj +++ b/SS14.MapServer/SS14.MapServer.csproj @@ -1,38 +1,38 @@ - net7.0 + net8.0 enable enable Linux - 1.1.3 + 1.1.4 - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - + + + + - - - - - - - - + + + + + + + + - + diff --git a/SS14.MapServer/Services/GitService.cs b/SS14.MapServer/Services/GitService.cs index b893acb..89518db 100644 --- a/SS14.MapServer/Services/GitService.cs +++ b/SS14.MapServer/Services/GitService.cs @@ -120,7 +120,7 @@ private void Pull(string repoDirectory, string gitRef) RunCommand(repoDirectory, "checkout --force", StripRef(gitRef)); _log.Debug("Pulling latest changes"); - RunCommand(repoDirectory, "pull origin HEAD --ff-only --force"); + RunCommand(repoDirectory, "pull origin --ff-only --force", StripRef(gitRef)); _log.Debug("Updating submodules"); RunCommand(repoDirectory, "submodule update --init --recursive"); diff --git a/docker-compose.yml b/docker-compose.yml index 919adae..bf3af3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,12 @@ services: - ./files:/app/data - ./build:/app/build ports: - - '5218':'80' #Replace 5218 with the port you need + - 5218:80 #Replace 5218 with the port you need + # Disables core dumps to prevent maprenderer crashes from filling up your hard drive with over a gigabyte per dump + ulimits: + core: + hard: 0 + soft: 0 map_database: image: postgres:latest environment: