FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /src COPY ["src/EventHub.IdentityServer/EventHub.IdentityServer.csproj", "src/EventHub.IdentityServer/"] RUN dotnet restore "src/EventHub.IdentityServer/EventHub.IdentityServer.csproj" COPY . . WORKDIR "/src/src/EventHub.IdentityServer" RUN dotnet dev-certs https -ep aspnetapp.pfx -p mypassword123 RUN dotnet dev-certs https --trust RUN dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p mypassword123 RUN dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p mypassword123 RUN dotnet build "EventHub.IdentityServer.csproj" -c Release -o /app FROM build AS publish RUN dotnet publish "EventHub.IdentityServer.csproj" -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "EventHub.IdentityServer.dll"]