a3d8654198
CI / backend (push) Successful in 52s
CI / frontend (push) Successful in 12s
CI / format (push) Successful in 48s
CI / db-tests (push) Successful in 51s
Deploy Staging / deploy (push) Successful in 26s
CI / backend (pull_request) Successful in 52s
CI / frontend (pull_request) Successful in 12s
CI / format (pull_request) Successful in 46s
CI / db-tests (pull_request) Successful in 50s
Security / secrets (push) Successful in 3s
Security / dependencies (push) Successful in 59s
Security / secrets (pull_request) Successful in 4s
Security / dependencies (pull_request) Successful in 57s
29 lines
1.2 KiB
Docker
29 lines
1.2 KiB
Docker
# Multi-stage build for the ASP.NET Core API.
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
WORKDIR /src
|
|
|
|
# Copy solution + project files first for layer-cached restore.
|
|
COPY Directory.Build.props ./
|
|
COPY src/InboxIntel.Domain/InboxIntel.Domain.csproj src/InboxIntel.Domain/
|
|
COPY src/InboxIntel.Application/InboxIntel.Application.csproj src/InboxIntel.Application/
|
|
COPY src/InboxIntel.Infrastructure/InboxIntel.Infrastructure.csproj src/InboxIntel.Infrastructure/
|
|
COPY src/InboxIntel.Api/InboxIntel.Api.csproj src/InboxIntel.Api/
|
|
RUN dotnet restore src/InboxIntel.Api/InboxIntel.Api.csproj
|
|
|
|
COPY src/ src/
|
|
RUN dotnet publish src/InboxIntel.Api/InboxIntel.Api.csproj -c Release -o /app/publish /p:UseAppHost=false
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
|
WORKDIR /app
|
|
COPY --from=build /app/publish .
|
|
|
|
# V-12: run as the non-root 'app' user shipped in the .NET 8 images. Pre-create the
|
|
# DataProtection key directory owned by that user so the (initially empty) 'keys'
|
|
# volume inherits app ownership on first mount and key persistence still works.
|
|
# NOTE: an EXISTING root-owned keys volume must be recreated for this to take effect.
|
|
RUN mkdir -p /keys && chown -R app:app /keys /app
|
|
USER app
|
|
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["dotnet", "InboxIntel.Api.dll"]
|