Commit ca17fc76 by guanzhenshan

增加dockerfile文件

parent bf52845c
#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/core/runtime:3.1-buster-slim AS base
WORKDIR /app
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["Bailun.DC.DailyInventorySummary/Bailun.DC.DailyInventorySummary.csproj", "Bailun.DC.DailyInventorySummary/"]
COPY ["Bailun.DC.Common/Bailun.DC.Common.csproj", "Bailun.DC.Common/"]
COPY ["Bailun.DC.Models/Bailun.DC.Models.csproj", "Bailun.DC.Models/"]
RUN dotnet restore "Bailun.DC.DailyInventorySummary/Bailun.DC.DailyInventorySummary.csproj"
COPY . .
WORKDIR "/src/Bailun.DC.DailyInventorySummary"
RUN dotnet build "Bailun.DC.DailyInventorySummary.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Bailun.DC.DailyInventorySummary.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Bailun.DC.DailyInventorySummary.dll"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment