FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base LABEL company="Winsomnia" LABEL maintainer.name="Wesser" maintainer.email="support@winsomnia.net" WORKDIR /app RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl --fail http://localhost:8080/health || exit 1 FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY . . RUN --mount=type=secret,id=nuget_username \ --mount=type=secret,id=nuget_token \ --mount=type=secret,id=nuget_source \ dotnet nuget add source $(cat /run/secrets/nuget_source) \ --name Winsomnia \ --username $(cat /run/secrets/nuget_username) \ --password $(cat /run/secrets/nuget_token) \ --store-password-in-clear-text RUN dotnet restore ./Backend.sln RUN dotnet publish Endpoint/Endpoint.csproj \ -c Release \ --self-contained false \ -p:PublishSingleFile=false \ -o /app FROM base AS final WORKDIR /app COPY --from=build /app . RUN find . -name "*.pdb" -type f -delete ENTRYPOINT ["dotnet", "Mirea.Api.Endpoint.dll"]