FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /App # Copy everything COPY . ./ # Restore as distinct layers RUN dotnet restore # Build and publish a release RUN dotnet publish -c Release -o out FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS app ENV ASPNETCORE_URLS=http://*:5089 WORKDIR /App COPY --from=build /App/out . ENTRYPOINT ["dotnet", "ApiRestaurant.dll"]