Closed gzh4455 closed 3 years ago
The Log Message: INFO Hangfire.SqlServer.SqlServerObjectsInstaller Start installing Hangfire SQL objects...
It is still stucking and can't start the web application .
The Environment is Docker + Net 5.0
the docker file looks below .
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim
COPY . /var/www/Centralism.Web
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /var/www/Centralism.Web
ENV ASPNETCORE_URLS http://+:50001
EXPOSE 50001 EXPOSE 443
ENTRYPOINT ["dotnet", "Centralism.Web.dll"]
Duplicates #1819
The Log Message: INFO Hangfire.SqlServer.SqlServerObjectsInstaller Start installing Hangfire SQL objects...
It is still stucking and can't start the web application .
The Environment is Docker + Net 5.0
the docker file looks below .
FROM 指定功能所需的基础镜像,必须是第一条指令,我们这里指定aspnetcore
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:5.0
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim
COPY 程序所在本地目录 容器目录
COPY . /var/www/Centralism.Web
database connection allow from tls 1.2 to tls 1.0
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
time zone
ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
定义你工作目录的名字
WORKDIR /var/www/Centralism.Web
指定项webapi或mvc站点的内部启动端口,默认是80
ENV ASPNETCORE_URLS http://+:50001
暴露docker容器端口
EXPOSE 50001 EXPOSE 443
运行dotnet命令,参数是你的程序集的入口dll--就是你的Web程序dll
ENTRYPOINT ["dotnet", "Centralism.Web.dll"]