mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-07-11 01:19:17 +00:00
Update to .NET Core 2.1 & pin images
This commit is contained in:
@@ -34,7 +34,7 @@ services:
|
||||
- back-tier
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
image: redis:5.0-alpine3.10
|
||||
container_name: redis
|
||||
ports: ["6379"]
|
||||
networks:
|
||||
|
||||
@@ -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,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