Skip to content

Commit 7c35973

Browse files
authored
Merge pull request #144 from nazimkov/add-sql-server-image
Add docker compose
2 parents 885572c + 5cf34f0 commit 7c35973

File tree

7 files changed

+71
-18
lines changed

7 files changed

+71
-18
lines changed

.dockerignore

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1+
**/.classpath
12
**/.dockerignore
23
**/.env
34
**/.git
45
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
59
**/.vs
610
**/.vscode
711
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
814
**/azds.yaml
9-
**/charts
1015
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
1121
**/obj
12-
**/Dockerfile
13-
**/Dockerfile.develop
14-
**/docker-compose.yml
15-
**/docker-compose.*.yml
16-
**/*.dbmdl
17-
**/*.jfm
1822
**/secrets.dev.yaml
1923
**/values.dev.yaml
20-
**/.toolstarget
24+
LICENSE
25+
README.md
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
1+
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS build
5+
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
66
WORKDIR /src
77
COPY ["IntegrationContainers.API/IntegrationContainers.API.csproj", "IntegrationContainers.API/"]
8+
COPY ["IntegrationContainers.Data/IntegrationContainers.Data.csproj", "IntegrationContainers.Data/"]
89
RUN dotnet restore "IntegrationContainers.API/IntegrationContainers.API.csproj"
910
COPY . .
1011
WORKDIR "/src/IntegrationContainers.API"
11-
RUN dotnet build "IntegrationContainers.API.csproj" -c Release -o /app
12+
RUN dotnet build "IntegrationContainers.API.csproj" -c Release -o /app/build
1213

1314
FROM build AS publish
14-
RUN dotnet publish "IntegrationContainers.API.csproj" -c Release -o /app
15+
RUN dotnet publish "IntegrationContainers.API.csproj" -c Release -o /app/publish
1516

1617
FROM base AS final
1718
WORKDIR /app
18-
COPY --from=publish /app .
19-
ENTRYPOINT ["dotnet", "IntegrationContainers.API.dll"]
19+
COPY --from=publish /app/publish .
20+
ENTRYPOINT ["dotnet", "IntegrationContainers.API.dll"]

IntegrationContainers.API/IntegrationContainers.API.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFramework>net5.0</TargetFramework>
55
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
66
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
7+
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
78
</PropertyGroup>
89

910
<ItemGroup>

IntegrationContainers.API/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
},
77
"AllowedHosts": "*",
88
"ConnectionStrings": {
9-
"UsersDb": "Server=tcp:127.0.0.1,1433;Database=UsersDb;User Id=sa;Password=Pass@word;"
9+
"UsersDb": "Server=integrationcontainers.db;Database=UsersDb;User=sa;Password=ekr2!qv@5#IM35O$;"
1010
}
1111
}

IntegrationContainers.sln

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29009.5
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationContainers.API", "IntegrationContainers.API\IntegrationContainers.API.csproj", "{726F677C-FC88-495D-9504-A95A213A4FC2}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationContainers.API", "IntegrationContainers.API\IntegrationContainers.API.csproj", "{726F677C-FC88-495D-9504-A95A213A4FC2}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationContainers.Data", "IntegrationContainers.Data\IntegrationContainers.Data.csproj", "{5D1D6D92-B546-4F2F-8B08-EF054A0D2FE8}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationContainers.Data", "IntegrationContainers.Data\IntegrationContainers.Data.csproj", "{5D1D6D92-B546-4F2F-8B08-EF054A0D2FE8}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4E42FBA5-4F43-460E-AE5C-4A69E15D64D1}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationContainers.API.Tests", "tests\IntegrationContainers.API.Tests\IntegrationContainers.API.Tests.csproj", "{D1B26BF0-3478-4A59-AA32-77E73B2D635A}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationContainers.API.Tests", "tests\IntegrationContainers.API.Tests\IntegrationContainers.API.Tests.csproj", "{D1B26BF0-3478-4A59-AA32-77E73B2D635A}"
13+
EndProject
14+
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{B6447C22-CA39-4043-873A-ACFAEBC61CF0}"
1315
EndProject
1416
Global
1517
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,6 +31,10 @@ Global
2931
{D1B26BF0-3478-4A59-AA32-77E73B2D635A}.Debug|Any CPU.Build.0 = Debug|Any CPU
3032
{D1B26BF0-3478-4A59-AA32-77E73B2D635A}.Release|Any CPU.ActiveCfg = Release|Any CPU
3133
{D1B26BF0-3478-4A59-AA32-77E73B2D635A}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{B6447C22-CA39-4043-873A-ACFAEBC61CF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{B6447C22-CA39-4043-873A-ACFAEBC61CF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{B6447C22-CA39-4043-873A-ACFAEBC61CF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{B6447C22-CA39-4043-873A-ACFAEBC61CF0}.Release|Any CPU.Build.0 = Release|Any CPU
3238
EndGlobalSection
3339
GlobalSection(SolutionProperties) = preSolution
3440
HideSolutionNode = FALSE

docker-compose.dcproj

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.1</ProjectVersion>
5+
<DockerTargetOS>Linux</DockerTargetOS>
6+
<ProjectGuid>b6447c22-ca39-4043-873a-acfaebc61cf0</ProjectGuid>
7+
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
8+
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/api/values</DockerServiceUrl>
9+
<DockerServiceName>integrationcontainers.api</DockerServiceName>
10+
</PropertyGroup>
11+
<ItemGroup>
12+
<None Include="docker-compose.override.yml">
13+
<DependentUpon>docker-compose.yml</DependentUpon>
14+
</None>
15+
<None Include="docker-compose.yml" />
16+
<None Include=".dockerignore" />
17+
</ItemGroup>
18+
</Project>

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.4'
2+
3+
services:
4+
integrationcontainers.api:
5+
image: ${DOCKER_REGISTRY-}integrationcontainersapi
6+
build:
7+
context: .
8+
dockerfile: IntegrationContainers.API/Dockerfile
9+
ports:
10+
- "5001:80"
11+
environment:
12+
- ASPNETCORE_ENVIRONMENT=Development
13+
depends_on:
14+
- integrationcontainers.db
15+
16+
integrationcontainers.db:
17+
image: "mcr.microsoft.com/mssql/server:2017-latest-ubuntu"
18+
ports:
19+
- "1433:1433"
20+
environment:
21+
SA_PASSWORD: "ekr2!qv@5#IM35O$$"
22+
ACCEPT_EULA: "Y"

0 commit comments

Comments
 (0)