Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Backend.Server/ProviderStartupExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using PayrollEngine.Api.Core;
using PayrollEngine.Backend.Controller;
using PayrollEngine.Domain.Application;
using PayrollEngine.Domain.Application.Service;
using PayrollEngine.Domain.Model;

Expand Down Expand Up @@ -221,6 +222,7 @@ public static IServiceCollection AddLocalApiServices(this IServiceCollection ser
ctx.GetRequiredService<IControllerRuntime>()));

// tenant controllers
services.AddTransient<ITenantService, TenantService>();
services.AddTransient(ctx => new TenantController(
ctx.GetRequiredService<ITenantService>(),
ctx.GetRequiredService<IRegulationService>(),
Expand Down
19 changes: 10 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
<TargetFramework>net9.0</TargetFramework>
<Version>0.9.0-beta.6</Version>
<FileVersion>0.9.0</FileVersion>
<InformationalVersion></InformationalVersion>
<Authors>Jani Giannoudis</Authors>
<Company>Software Consulting Giannoudis</Company>
<Copyright>2025 Software Consulting Giannoudis</Copyright>
<Product>Payroll Engine Backend Server</Product>
<PackageProjectUrl>https://payrollengine.org/</PackageProjectUrl>
<RepositoryUrl>https://github.com/Payroll-Engine/PayrollEngine.Backend.git</RepositoryUrl>
<NoWarn>1701;1702;8034;AD0001;RMG020;RMG012</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<InformationalVersion>0.9.0-beta.6</InformationalVersion>
<Description>Payroll Engine Backend</Description>
<Company>Payroll Engine GmbH</Company>
<Product>Payroll Engine</Product>
<Copyright>Copyright © 2024</Copyright>
<NeutralLanguage>en</NeutralLanguage>
<Nullable>enable</Nullable>
<!-- Docker build compatibility: suppress nullable warnings and treat them as non-blocking -->
<NoWarn>1701;1702;8034;AD0001;RMG020;RMG012;CS8618</NoWarn>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

Expand Down
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Build stage with multi-platform support
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG TARGETARCH
ARG BUILDPLATFORM
WORKDIR /src

# copy solution and project files
COPY ["PayrollEngine.Backend.sln", "./"]
COPY ["Api/Api.Controller/PayrollEngine.Api.Controller.csproj", "Api/Api.Controller/"]
COPY ["Api/Api.Core/PayrollEngine.Api.Core.csproj", "Api/Api.Core/"]
COPY ["Api/Api.Map/PayrollEngine.Api.Map.csproj", "Api/Api.Map/"]
COPY ["Api/Api.Model/PayrollEngine.Api.Model.csproj", "Api/Api.Model/"]
COPY ["Backend.Controller/PayrollEngine.Backend.Controller.csproj", "Backend.Controller/"]
COPY ["Backend.Server/PayrollEngine.Backend.Server.csproj", "Backend.Server/"]
COPY ["Domain/Domain.Application/PayrollEngine.Domain.Application.csproj", "Domain/Domain.Application/"]
COPY ["Domain/Domain.Model/PayrollEngine.Domain.Model.csproj", "Domain/Domain.Model/"]
COPY ["Domain/Domain.Model.Tests/PayrollEngine.Domain.Model.Tests.csproj", "Domain/Domain.Model.Tests/"]
COPY ["Domain/Domain.Scripting/PayrollEngine.Domain.Scripting.csproj", "Domain/Domain.Scripting/"]
COPY ["Persistence/Persistence/PayrollEngine.Persistence.csproj", "Persistence/Persistence/"]
COPY ["Persistence/Persistence.SqlServer/PayrollEngine.Persistence.SqlServer.csproj", "Persistence/Persistence.SqlServer/"]

# copy Directory.Build.props files
COPY ["Directory.Build.props", "./"]

# Restore with architecture-specific runtime
RUN if [ "$TARGETARCH" = "arm64" ]; then \
dotnet restore "PayrollEngine.Backend.sln" --runtime linux-arm64; \
else \
dotnet restore "PayrollEngine.Backend.sln" --runtime linux-x64; \
fi

# copy everything else
COPY . .
WORKDIR "/src/Backend.Server"

# Publish with architecture-specific runtime and restore included
RUN if [ "$TARGETARCH" = "arm64" ]; then \
dotnet publish "PayrollEngine.Backend.Server.csproj" -c Release -o /app/publish --runtime linux-arm64 --self-contained false; \
else \
dotnet publish "PayrollEngine.Backend.Server.csproj" -c Release -o /app/publish --runtime linux-x64 --self-contained false; \
fi

# final stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "PayrollEngine.Backend.Server.dll"]