# ── Stage 1: Build ──────────────────────────────────────────────────────────── FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY Directory.Build.props Directory.Packages.props ./ COPY SOR.slnx ./ # SOR.Admin depends on SOR.Ai (Phase 3 calibration), which pulls in SOR.Game. COPY src/SOR.Admin/SOR.Admin.csproj src/SOR.Admin/ COPY src/SOR.Ai/SOR.Ai.csproj src/SOR.Ai/ COPY src/SOR.Cdn/SOR.Cdn.csproj src/SOR.Cdn/ COPY src/SOR.Database/SOR.Database.csproj src/SOR.Database/ COPY src/SOR.Game/SOR.Game.csproj src/SOR.Game/ COPY src/SOR.Shared/SOR.Shared.csproj src/SOR.Shared/ COPY src/SOR.Networking.Abstractions/SOR.Networking.Abstractions.csproj src/SOR.Networking.Abstractions/ RUN dotnet restore src/SOR.Admin/SOR.Admin.csproj # Copy full source (needed for migrations embedded in SOR.Database). COPY . . RUN dotnet publish src/SOR.Admin/SOR.Admin.csproj \ -c Release \ --no-restore \ -o /app/publish # ── Stage 2: Runtime ────────────────────────────────────────────────────────── FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime WORKDIR /app RUN adduser --disabled-password --gecos "" appuser USER appuser COPY --from=build --chown=appuser:appuser /app/publish . EXPOSE 8080 ENV ASPNETCORE_URLS=http://+:8080 ENV ASPNETCORE_ENVIRONMENT=Production ENTRYPOINT ["dotnet", "SOR.Admin.dll"]