新增Dockerfile支持

development
温天培 2 years ago
parent 615e8e46e3
commit 41fec886fd

@ -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"]

@ -13,7 +13,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDZZ.Application", "GDZZ.Ap
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDZZ.FlowCenter", "GDZZ.FlowCenter\GDZZ.FlowCenter.csproj", "{79C7E074-1029-4E65-B8AB-8ED26B4426AF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GDZZ.FlowCenter", "GDZZ.FlowCenter\GDZZ.FlowCenter.csproj", "{79C7E074-1029-4E65-B8AB-8ED26B4426AF}"
EndProject 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

Loading…
Cancel
Save