We create docker image for our application build on top of abp commercial. The following is Dockerfile for IdentityServer (we run it as separated deployment)
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY . .
WORKDIR "/src/aspnet-core/src/On.Ops.IdentityServer"
RUN dotnet restore
RUN dotnet publish -c Release -o /app
RUN dotnet dev-certs https -v -ep /app/identityserver.pfx -p 2D7AA457-5D33-48D6-936F-C48E5EF468ED
FROM build AS publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "On.Ops.IdentityServer.dll"]
But it cannot run when start instance.
We try to publish the application with
dotnet publish dotnet publish -c Release
1 Answer(s)
-
0
If you want to build your image locally, see my answer for dockerfile.
dotnet dev-certs https -v -ep /app/identityserver.pfx -p 2D7AA457-5D33-48D6-936F-C48E5EF468ED
This doesn't work for production, it only generates certificate for localhost.
If you are publishing to Azure, you can use free azure HTTPS certificates. Or you can generate a self-signed certificate for your application. You can check how to generate self-signed certificate using openssl.
If you are publishing IdentityServer, you can check IdentityServer Deployment docs.