Skip to content

Commit 400e44d

Browse files
committed
Add docker to the monolithic app
1 parent 272781d commit 400e44d

11 files changed

Lines changed: 112 additions & 34 deletions

eShopWeb.sln

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '2'
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 ./eShopWeb.sln && dotnet publish ./eShopWeb.sln -c Release -o ./obj/Docker/publish"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>91cd7b6e-a849-48c1-b058-4bc47c4cd978</ProjectGuid>
5+
<DockerLaunchBrowser>True</DockerLaunchBrowser>
6+
<DockerServiceUrl>http://localhost:{ServicePort}</DockerServiceUrl>
7+
<DockerServiceName>eshopweb</DockerServiceName>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<None Include="docker-compose.ci.build.yml" />
11+
<None Include="docker-compose.override.yml">
12+
<DependentUpon>docker-compose.yml</DependentUpon>
13+
</None>
14+
<None Include="docker-compose.vs.debug.yml">
15+
<DependentUpon>docker-compose.yml</DependentUpon>
16+
</None>
17+
<None Include="docker-compose.vs.release.yml">
18+
<DependentUpon>docker-compose.yml</DependentUpon>
19+
</None>
20+
<None Include="docker-compose.yml" />
21+
</ItemGroup>
22+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '2'
2+
3+
services:
4+
eshopweb:
5+
environment:
6+
- ASPNETCORE_ENVIRONMENT=Development
7+
ports:
8+
- "5106:5106"
9+
10+
sql.data:
11+
environment:
12+
- SA_PASSWORD=Pass@word
13+
- ACCEPT_EULA=Y
14+
ports:
15+
- "5433:1433"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '2'
2+
3+
services:
4+
eshopweb:
5+
image: eshop/web:dev
6+
build:
7+
args:
8+
source: ${DOCKER_BUILD_SOURCE}
9+
environment:
10+
- DOTNET_USE_POLLING_FILE_WATCHER=1
11+
volumes:
12+
- ./eShopWeb:/app
13+
- ~/.nuget/packages:/root/.nuget/packages:ro
14+
- ~/clrdbg:/clrdbg:ro
15+
entrypoint: tail -f /dev/null
16+
labels:
17+
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '2'
2+
3+
services:
4+
eshopweb:
5+
build:
6+
args:
7+
source: ${DOCKER_BUILD_SOURCE}
8+
volumes:
9+
- ~/clrdbg:/clrdbg:ro
10+
entrypoint: tail -f /dev/null
11+
labels:
12+
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '2'
2+
3+
services:
4+
eshopweb:
5+
image: eshop/web
6+
build:
7+
context: ./eShopWeb
8+
dockerfile: Dockerfile
9+
depends_on:
10+
- sql.data
11+
sql.data:
12+
image: microsoft/mssql-server-linux

src/Web/WebMonolithic/eShopWeb.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.26206.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopWeb", "eShopWeb\eShopWeb.csproj", "{CA5B730B-7195-4E29-B030-A2007E004B98}"
77
EndProject
8+
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{91CD7B6E-A849-48C1-B058-4BC47C4CD978}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -27,6 +29,18 @@ Global
2729
{CA5B730B-7195-4E29-B030-A2007E004B98}.Release|x64.Build.0 = Release|x64
2830
{CA5B730B-7195-4E29-B030-A2007E004B98}.Release|x86.ActiveCfg = Release|x86
2931
{CA5B730B-7195-4E29-B030-A2007E004B98}.Release|x86.Build.0 = Release|x86
32+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Debug|x64.ActiveCfg = Debug|Any CPU
35+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Debug|x64.Build.0 = Debug|Any CPU
36+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Debug|x86.ActiveCfg = Debug|Any CPU
37+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Debug|x86.Build.0 = Debug|Any CPU
38+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Release|x64.ActiveCfg = Release|Any CPU
41+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Release|x64.Build.0 = Release|Any CPU
42+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Release|x86.ActiveCfg = Release|Any CPU
43+
{91CD7B6E-A849-48C1-B058-4BC47C4CD978}.Release|x86.Build.0 = Release|Any CPU
3044
EndGlobalSection
3145
GlobalSection(SolutionProperties) = preSolution
3246
HideSolutionNode = FALSE
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!obj/Docker/publish/*
3+
!obj/Docker/empty/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM microsoft/aspnetcore:1.0
2+
ARG source
3+
WORKDIR /app
4+
EXPOSE 80
5+
COPY ${source:-obj/Docker/publish} .
6+
ENTRYPOINT ["dotnet", "eShopWeb.dll"]

0 commit comments

Comments
 (0)