mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-07-11 01:19:17 +00:00
@@ -1,10 +1,16 @@
|
||||
FROM microsoft/dotnet:2.0.0-sdk
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 as builder
|
||||
|
||||
WORKDIR /code
|
||||
WORKDIR /Worker
|
||||
COPY src/Worker/Worker.csproj .
|
||||
RUN dotnet restore
|
||||
|
||||
ADD src/Worker /code/src/Worker
|
||||
COPY src/Worker/ .
|
||||
RUN dotnet publish -c Release -o /out Worker.csproj
|
||||
|
||||
RUN dotnet restore -v minimal src/Worker \
|
||||
&& dotnet publish -c Release -o "./" "src/Worker/"
|
||||
# app image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:2.1
|
||||
|
||||
CMD dotnet src/Worker/Worker.dll
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["dotnet", "Worker.dll"]
|
||||
|
||||
COPY --from=builder /out .
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 as builder
|
||||
|
||||
WORKDIR /Worker
|
||||
COPY Worker/Worker.csproj .
|
||||
@@ -8,7 +8,7 @@ COPY /Worker .
|
||||
RUN dotnet publish -c Release -o /out Worker.csproj
|
||||
|
||||
# app image
|
||||
FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:2.1
|
||||
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["dotnet", "Worker.dll"]
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<AssemblyName>Worker</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<PackageId>Worker</PackageId>
|
||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StackExchange.Redis" Version="1.1.604-alpha" />
|
||||
<PackageReference Include="Npgsql" Version="3.1.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.0.601" />
|
||||
<PackageReference Include="Npgsql" Version="4.0.9" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user