Skip to content

Commit 032f209

Browse files
authored
Merge pull request #117 from progaudi/docker/debug
Docker/debug & codeowners.
2 parents 96f11ad + 3c5665b commit 032f209

File tree

8 files changed

+78
-23
lines changed

8 files changed

+78
-23
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@progaudi/core-team
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3'
2+
3+
services:
4+
ci-build:
5+
image: microsoft/aspnetcore-build:1.0-1.1
6+
volumes:
7+
- .:/src
8+
working_dir: /src
9+
command: /bin/bash -c "dotnet restore ./dotnet.sln && dotnet publish ./dotnet.sln -c Release -o ./obj/Docker/publish"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
3+
<PropertyGroup Label="Globals">
4+
<ProjectVersion>2.0</ProjectVersion>
5+
<DockerTargetOS>Linux</DockerTargetOS>
6+
<ProjectGuid>62d083cf-fad4-4b3f-bfe5-14f7d601736a</ProjectGuid>
7+
<DockerLaunchBrowser>True</DockerLaunchBrowser>
8+
<DockerServiceUrl>http://localhost:{ServicePort}</DockerServiceUrl>
9+
<DockerServiceName>dotnet</DockerServiceName>
10+
</PropertyGroup>
11+
<ItemGroup>
12+
<None Include="docker-compose.ci.build.yml" />
13+
<None Include="docker-compose.override.yml">
14+
<DependentUpon>docker-compose.yml</DependentUpon>
15+
</None>
16+
<None Include="docker-compose.yml" />
17+
</ItemGroup>
18+
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: '3'
2+
3+
services:
4+
dotnet:
5+
environment:
6+
- ASPNETCORE_ENVIRONMENT=Development
7+
- ASPNETCORE_URLS=http://*:5000
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
version: '2'
1+
version: '3'
22

33
services:
44
tarantool1:
55
image: tarantool/tarantool:1.7
66
command: tarantool /usr/local/share/tarantool/sample.init.lua
77
volumes:
8-
- $PWD/tarantool:/usr/local/share/tarantool
8+
- ./tarantool:/usr/local/share/tarantool
99
environment:
1010
TARANTOOL_REPLICATION_SOURCE: "replicator:234234@tarantool1,replicator:234234@tarantool2"
1111
TARANTOOL_REPLICATION_USER: replicator
@@ -15,17 +15,19 @@ services:
1515
image: tarantool/tarantool:1.7
1616
command: tarantool /usr/local/share/tarantool/sample.init.lua
1717
volumes:
18-
- $PWD/tarantool:/usr/local/share/tarantool
18+
- ./tarantool:/usr/local/share/tarantool
1919
environment:
2020
TARANTOOL_REPLICATION_SOURCE: "replicator:234234@tarantool1,replicator:234234@tarantool2"
2121
TARANTOOL_REPLICATION_USER: replicator
2222
TARANTOOL_USER_PASSWORD: "234234"
2323

2424
dotnet:
25+
image: dotnet
2526
build:
26-
context: $PWD/dotnet
27+
context: ./dotnet
28+
dockerfile: Dockerfile
2729
depends_on:
2830
- tarantool1
2931
- tarantool2
3032
ports:
31-
- 5000:5000
33+
- 5000:5000

samples/docker-compose/dotnet.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet", "dotnet\dotnet.csproj", "{E5AD1C81-E362-46E3-9B81-4F99F268FF8C}"
7+
EndProject
8+
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{62D083CF-FAD4-4B3F-BFE5-14F7D601736A}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{E5AD1C81-E362-46E3-9B81-4F99F268FF8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{E5AD1C81-E362-46E3-9B81-4F99F268FF8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{E5AD1C81-E362-46E3-9B81-4F99F268FF8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{E5AD1C81-E362-46E3-9B81-4F99F268FF8C}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{62D083CF-FAD4-4B3F-BFE5-14F7D601736A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{62D083CF-FAD4-4B3F-BFE5-14F7D601736A}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{62D083CF-FAD4-4B3F-BFE5-14F7D601736A}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{62D083CF-FAD4-4B3F-BFE5-14F7D601736A}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {B1E13618-C27F-4984-9228-53977CB722FA}
30+
EndGlobalSection
31+
EndGlobal

samples/docker-compose/dotnet/Controllers/HomeController.cs

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using System;
2-
using System.Linq;
31
using System.Threading.Tasks;
42
using dotnet.Models;
53
using Microsoft.AspNetCore.Mvc;
6-
using ProGaudi.MsgPack.Light;
74
using ProGaudi.Tarantool.Client;
85
using ProGaudi.Tarantool.Client.Model;
96
using ProGaudi.Tarantool.Client.Model.Enums;
@@ -12,30 +9,20 @@ namespace dotnet.Controllers
129
{
1310
public class HomeController : Controller
1411
{
15-
private readonly Box _box;
16-
private readonly ISpace _space;
1712
private readonly IIndex _primaryIndex;
1813
private readonly IIndex _secondaryIndex;
1914

20-
public HomeController(Box box)
21-
{
22-
_box = box;
23-
24-
var result = Initialize().GetAwaiter().GetResult();
25-
_space = result.Item1;
26-
_primaryIndex = result.Item2;
27-
_secondaryIndex = result.Item3;
28-
}
15+
public HomeController(Box box) => (_primaryIndex, _secondaryIndex) = Initialize(box).GetAwaiter().GetResult();
2916

30-
private async Task<Tuple<ISpace, IIndex, IIndex>> Initialize()
17+
private static async Task<(IIndex, IIndex)> Initialize(IBox box)
3118
{
32-
var schema = _box.GetSchema();
19+
var schema = box.GetSchema();
3320

3421
var space = await schema.GetSpace("some_space");
3522
var primaryIndex = await space.GetIndex("primary");
3623
var index = await space.GetIndex("some_secondary_index");
3724

38-
return Tuple.Create(space, primaryIndex, index);
25+
return (primaryIndex, index);
3926
}
4027

4128
public async Task<ViewResult> Index()

samples/docker-compose/dotnet/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ RUN dotnet build -c Release -f netcoreapp2.0 /app/dotnet.csproj
99

1010
EXPOSE 5000/tcp
1111

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

0 commit comments

Comments
 (0)