提交 e9e4ca03 编写于 作者: 麦壳饼's avatar 麦壳饼

add dockerfile

上级 d45c3d6c
#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/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["IoTSharp/IoTSharp.csproj", "IoTSharp/"]
COPY ["IoTSharp.Extensions/IoTSharp.Extensions.csproj", "IoTSharp.Extensions/"]
COPY ["IoTSharp.Extensions.AspNetCore/IoTSharp.Extensions.AspNetCore.csproj", "IoTSharp.Extensions.AspNetCore/"]
RUN dotnet restore "IoTSharp/IoTSharp.csproj"
COPY . .
WORKDIR "/src/IoTSharp"
RUN dotnet build "IoTSharp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "IoTSharp.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "IoTSharp.dll"]
\ No newline at end of file
......@@ -20,6 +20,7 @@
<PackageTags>IoT</PackageTags>
<PackageIcon>https://avatars2.githubusercontent.com/u/44353254?s=200&amp;v=4</PackageIcon>
<ApplicationIcon>Resources\Logo.ico</ApplicationIcon>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
......@@ -66,7 +67,6 @@
<Content Remove="Migrations\**" />
<EmbeddedResource Remove="Migrations\**" />
<None Remove="Migrations\**" />
<None Include="..\Dockerfile" Link="Dockerfile" />
<None Include="..\LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册