Skip to content

Commit e7080db

Browse files
committed
Update sample
1 parent ee12711 commit e7080db

File tree

5 files changed

+17
-26
lines changed

5 files changed

+17
-26
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM progaudi/dotnet:1.0.1-xenial
1+
FROM microsoft/dotnet:2.0.0-sdk
22

33
WORKDIR /app
44
ADD dotnet.csproj /app/dotnet.csproj
5-
RUN /root/.dotnet/dotnet restore
5+
RUN dotnet restore
66

77
ADD . /app
8-
RUN /root/.dotnet/dotnet build -c Release -f netcoreapp1.1 /app/dotnet.csproj
8+
RUN dotnet build -c Release -f netcoreapp2.0 /app/dotnet.csproj
99

1010
EXPOSE 5000/tcp
1111

12-
CMD ["/root/.dotnet/dotnet", "run", "--server.urls", "http://*:5000"]
12+
CMD ["dotnet", "run", "--server.urls", "http://*:5000"]

samples/docker-compose/dotnet/Program.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.IO;
1+
using Microsoft.AspNetCore;
22
using Microsoft.AspNetCore.Hosting;
33
using Microsoft.Extensions.Configuration;
44

@@ -10,13 +10,12 @@ public static void Main(string[] args)
1010
{
1111
var config = new ConfigurationBuilder()
1212
.AddCommandLine(args)
13-
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
13+
.AddEnvironmentVariables("ASPNETCORE_")
1414
.Build();
1515

16-
var host = new WebHostBuilder()
16+
var host = WebHost
17+
.CreateDefaultBuilder(args)
1718
.UseConfiguration(config)
18-
.UseKestrel()
19-
.UseContentRoot(Directory.GetCurrentDirectory())
2019
.UseStartup<Startup>()
2120
.Build();
2221

samples/docker-compose/dotnet/Views/Home/DogTablePartial.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</tbody>
2525
<tfoot>
2626
<tr>
27-
<td colspan="3">@Model.Dogs.Count dogs total</td>
27+
<td colspan="4">@Model.Dogs.Count dogs total</td>
2828
</tr>
2929
</tfoot>
3030
</table>

samples/docker-compose/dotnet/Views/Home/Index.cshtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
ViewData["Title"] = "Tarantool demo page";
55
}
66

7+
<h1>Render time is @DateTimeOffset.Now.ToString("F")</h1>
8+
79
@Html.Partial("DogTablePartial", new DogTable(Model[0], "All dogs in Tarantool"))
810

911
@Html.Partial("DogTablePartial", new DogTable(Model[1], "Senior dogs in Tarantool"))
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
4-
<TargetFramework>netcoreapp1.1</TargetFramework>
5-
<PreserveCompilationContext>true</PreserveCompilationContext>
3+
<TargetFramework>netcoreapp2.0</TargetFramework>
64
</PropertyGroup>
75
<ItemGroup>
8-
<Folder Include="wwwroot\" />
6+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
7+
<PackageReference Include="progaudi.tarantool" Version="0.9.0" />
98
</ItemGroup>
109
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
12-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.0" />
15-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
16-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" />
17-
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
18-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
19-
<PackageReference Include="msgpack.light" Version="1.3.0" />
20-
<PackageReference Include="progaudi.tarantool" Version="0.8.0" />
10+
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
2111
</ItemGroup>
22-
</Project>
12+
</Project>

0 commit comments

Comments
 (0)