diff --git a/src/services/catalog-service/dockerfile b/src/services/catalog-service/dockerfile index a7ab30e8..f6a106f2 100644 --- a/src/services/catalog-service/dockerfile +++ b/src/services/catalog-service/dockerfile @@ -1,19 +1,14 @@ # Build Image FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build -WORKDIR /app - -RUN dotnet restore "catalog-service.csproj" +WORKDIR /build COPY . . -WORKDIR "/app/catalog-service" - -RUN dotnet build "catalog-service.csproj" -c Release -o /app/build -FROM build as publish -RUN dotnet publish "catalog-service.csproj" -c Release -o /app/publish +RUN dotnet restore "catalog-service.csproj" +RUN dotnet publish -c Release -o /app # Runtime Image FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled AS final WORKDIR /app -COPY --from=publish /app . +COPY --from=build /app . ENTRYPOINT ["dotnet", "catalog-service.dll"] # Build Image