netcore dockfile的配置

分类: NetCore
  1. #使用MYSQL请使用以下命令
  2. FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
  3. #设置时区
  4. RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  5. RUN echo 'Asia/Shanghai' >/etc/timezone
  6. #设置环境变量,http请求在linux下面有可能出现https访问被拒绝问题
  7. ENV DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER 0
  8. WORKDIR api
  9. #项目设置里面将所有需要输出的xml文件输出到同一个doc目录下面
  10. ADD ./bin/Release/netcoreapp3.1/publish/ /api/
  11. ENTRYPOINT ["dotnet","/api/fx110.core.rights.api.dll","--environment","test"]
  12. #以下解决在容器内访问SQLSERVER出现的连接超时问题
  13. #使用MSSQL请使用以下命令
  14. #解决容器内访问SQLSERVER出现的连接超时的问题
  15. #错误描述:SQLSERVER:Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
  16. #FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
  17. #
  18. ##设置时区
  19. #RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  20. #RUN echo 'Asia/Shanghai' >/etc/timezone
  21. #
  22. ##设置环境变量,http请求在linux下面有可能出现https访问被拒绝问题
  23. #ENV DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER 0
  24. #
  25. #RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
  26. #RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
  27. #RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf
  28. #RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /usr/lib/ssl/openssl.cnf
  29. #
  30. #WORKDIR api
  31. ##项目设置里面将所有需要输出的xml文件输出到同一个doc目录下面
  32. #ADD ./bin/Release/netcoreapp3.1/publish/ /api/
  33. #
  34. #ENTRYPOINT ["dotnet","/api/fx110.core.rights.api.dll","--environment","test"]
标签: k8s NetCore

上一篇: netcore 跨域配置

下一篇: 【NetCore】API【网络加速】输出自定义字段、重命名以及日期格式自定义的玩法。

by 2023-08-07 23:49:07
篇笔记

学习笔记