#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 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 ["Znyc.Dispatching.Web.Entry/Znyc.Dispatching.Web.Entry.csproj", "Znyc.Dispatching.Web.Entry/"] COPY ["Znyc.Dispatching.Web.Core/Znyc.Dispatching.Web.Core.csproj", "Znyc.Dispatching.Web.Core/"] COPY ["Znyc.Dispatching.Database.Migrations/Znyc.Dispatching.Database.Migrations.csproj", "Znyc.Dispatching.Database.Migrations/"] COPY ["Znyc.Dispatching.EntityFramework.Core/Znyc.Dispatching.EntityFramework.Core.csproj", "Znyc.Dispatching.EntityFramework.Core/"] COPY ["Znyc.Dispatching.Core/Znyc.Dispatching.Core.csproj", "Znyc.Dispatching.Core/"] COPY ["Znyc.Dispatching.Application/Znyc.Dispatching.Application.csproj", "Znyc.Dispatching.Application/"] COPY ["Znyc.Dispatching.MongoDb.Repository/Znyc.Dispatching.MongoDb.Repository.csproj", "Znyc.Dispatching.MongoDb.Repository/"] COPY ["Znyc.Dispatching.WeChat.Core/Znyc.Dispatching.WeChat.Core.csproj", "Znyc.Dispatching.WeChat.Core/"] RUN dotnet restore "Znyc.Dispatching.Web.Entry/Znyc.Dispatching.Web.Entry.csproj" COPY . . WORKDIR "/src/Znyc.Dispatching.Web.Entry" RUN dotnet build "Znyc.Dispatching.Web.Entry.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "Znyc.Dispatching.Web.Entry.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Znyc.Dispatching.Web.Entry.dll"]