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
9 changes: 7 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
<TargetFramework>net9.0</TargetFramework>
<Version>0.9.0-beta.6</Version>
<FileVersion>0.9.0</FileVersion>
<InformationalVersion></InformationalVersion>
<InformationalVersion>0.9.0-beta.6</InformationalVersion>
<Description>Payroll Engine WebApp</Description>
<Company>Payroll Engine GmbH</Company>
<Product>Payroll Engine</Product>
<Copyright>Copyright © 2024</Copyright>
<NeutralLanguage>en</NeutralLanguage>
<Nullable>enable</Nullable>
<Authors>Jani Giannoudis</Authors>
<Company>Software Consulting Giannoudis</Company>
<Copyright>2025 Software Consulting Giannoudis</Copyright>
<Product>Payroll Engine Web Application</Product>
<PackageProjectUrl>https://payrollengine.org/</PackageProjectUrl>
<RepositoryUrl>https://github.com/Payroll-Engine/PayrollEngine.WebApp.git</RepositoryUrl>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
Expand Down
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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.WebApp.sln", "./"]
COPY ["Core/PayrollEngine.WebApp.Core.csproj", "Core/"]
COPY ["Presentation/PayrollEngine.WebApp.Presentation.csproj", "Presentation/"]
COPY ["Server/PayrollEngine.WebApp.Server.csproj", "Server/"]
COPY ["Shared/PayrollEngine.WebApp.Shared.csproj", "Shared/"]
COPY ["ViewModel/PayrollEngine.WebApp.ViewModel.csproj", "ViewModel/"]

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

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

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

# Publish with architecture-specific runtime and restore included
RUN if [ "$TARGETARCH" = "arm64" ]; then \
dotnet publish "PayrollEngine.WebApp.Server.csproj" -c Release -o /app/publish --runtime linux-arm64 --self-contained false; \
else \
dotnet publish "PayrollEngine.WebApp.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.WebApp.Server.dll"]