You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

FROM mcr.microsoft.com/dotnet/aspnet:7.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:7.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"]