FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base WORKDIR /app EXPOSE 80 FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src COPY src/Services/Catalog/Catalog.API/Catalog.API.csproj … COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks … COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks … COPY src/BuildingBlocks/EventBus/IntegrationEventLogEF/ … COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj … COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj … COPY src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj … COPY src/BuildingBlocks/WebHostCustomization/WebHost.Customization … COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions … COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions … RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj COPY . . WORKDIR /src/src/Services/Catalog/Catalog.API RUN dotnet build Catalog.API.csproj -c Release -o /app FROM build AS publish RUN dotnet publish Catalog.API.csproj -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "Catalog.API.dll"]