如果要使用自己的自制憑證和跑在 docker上,我的 dockerfile和 appsetting.json檔案參考如下:
docker file
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
ENV ASPNETCORE_URLS https://*:443
EXPOSE 443
COPY . /app
ENV ASPNETCORE_ENVIRONMENT production
ENTRYPOINT ["dotnet", "xxxxx.dll"]
appsetting.json
{
"ConnectionStrings": {
................................................
},
"Logging": {
.....................................
},
"Kestrel": {
"Certificates": {
"Default": {
"Path": "certificate_file_name.pfx",
"Password": "xxxxxxxxxxxxxxx"
},
"AllowInvalid": "true"
}
}
}
沒有留言:
張貼留言