diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f30158 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN sed -i 's@/deb.debian.org/@/mirrors.aliyun.com/@g' /etc/apt/sources.list +RUN apt-get clean +RUN apt update && apt install libgdiplus -y +RUN ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll + +COPY msyh.ttc /usr/share/fonts/msyh.tt +COPY msyhbd.ttc /usr/share/fonts/msyhbd.tt +COPY msyhl.ttc /usr/share/fonts/msyhl.tt + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["GDZZ.Web.Entry/GDZZ.Web.Entry.csproj", "GDZZ.Web.Entry/"] +COPY ["GDZZ.Web.Core/GDZZ.Web.Core.csproj", "GDZZ.Web.Core/"] +COPY ["GDZZ.Core/GDZZ.Core.csproj", "GDZZ.Core/"] +COPY ["GDZZ.CodeFirst/GDZZ.CodeFirst.csproj", "GDZZ.CodeFirst/"] +COPY ["GDZZ.Application/GDZZ.Application.csproj", "GDZZ.Application/"] + + +RUN dotnet restore "GDZZ.Web.Entry/GDZZ.Web.Entry.csproj" +COPY . . +WORKDIR "/src/GDZZ.Web.Entry" +RUN dotnet build "GDZZ.Web.Entry.csproj" -c Release -o /app/build + + + +FROM build AS publish +RUN dotnet publish "GDZZ.Web.Entry.csproj" -c Release -o /app/publish + + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "GDZZ.Web.Entry.dll"] \ No newline at end of file diff --git a/GDZZ.sln b/GDZZ.sln index d6824a4..7ff1d87 100644 --- a/GDZZ.sln +++ b/GDZZ.sln @@ -13,7 +13,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDZZ.Application", "GDZZ.Ap EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDZZ.FlowCenter", "GDZZ.FlowCenter\GDZZ.FlowCenter.csproj", "{79C7E074-1029-4E65-B8AB-8ED26B4426AF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GDZZ.CodeFirst", "GDZZ.CodeFirst\GDZZ.CodeFirst.csproj", "{E75A7323-4369-4EC5-A8BE-5E127C0AC38E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDZZ.CodeFirst", "GDZZ.CodeFirst\GDZZ.CodeFirst.csproj", "{E75A7323-4369-4EC5-A8BE-5E127C0AC38E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docker", "Docker", "{DFF1AFDC-3203-4914-AAFD-9303BC953C7E}" + ProjectSection(SolutionItems) = preProject + Dockerfile.txt = Dockerfile.txt + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution