WebMVC project folder simplified and migrated to latest version of VS Tools for Docker

This commit is contained in:
Cesar De la Torre 2016-10-07 17:13:05 -07:00
parent 4da23ad259
commit 8cc57c2542
119 changed files with 102 additions and 29 deletions

32
build-docker-images.ps1 Normal file
View File

@ -0,0 +1,32 @@
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
$pubFolderToDelete = $scriptPath + "\pub"
remove-item -path $pubFolderToDelete -Force -Recurse -ErrorAction SilentlyContinue
#cmd /c "rd /s pub" /q
$webPathToJson = $scriptPath + "\src\Web\WebMVC\project.json"
Write-Host "webPathToJson is $webPathToJson" -ForegroundColor Yellow
$webPathToPub = $scriptPath + "\pub\webMVC"
Write-Host "webPathToPub is $webPathToPub" -ForegroundColor Yellow
dotnet publish $webPathToJson -o $webPathToPub
$catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
$catalogPathToPub = $scriptPath + "\pub\catalog"
Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
dotnet publish $catalogPathToJson -o $catalogPathToPub
$orderingPathToJson = $scriptPath + "\src\Services\Ordering\Ordering.API\project.json"
Write-Host "orderingPathToJson is $orderingPathToJson" -ForegroundColor Yellow
$orderingPathToPub = $scriptPath + "\pub\ordering"
Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
dotnet publish $orderingPathToJson -o $orderingPathToPub
docker build -t eshop/web $webPathToPub
docker build -t eshop/catalog.api $catalogPathToPub
docker build -t eshop/ordering.api $orderingPathToPub

View File

@ -27,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Basket", "Basket", "{BF3EF4
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ordering", "Ordering", "{0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopOnContainers.WebMVC", "src\Web\Microsoft.eShopOnContainers.WebMVC\eShopOnContainers.WebMVC.xproj", "{F0333D8E-0B27-42B7-B2C6-78F3657624E2}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Basket.API", "src\Services\Basket\Basket.API\Basket.API.xproj", "{2110CBB0-3B38-4EE4-A743-DF6968D80D90}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Catalog.API", "src\Services\Catalog\Catalog.API\Catalog.API.xproj", "{42681D9D-750A-4DF7-BD9F-9292CFD5C253}"
@ -49,16 +47,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Console App", "Console App"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopConsole", "src\Console\eShopConsole\eShopConsole.xproj", "{C10C7B69-CE4F-4167-928E-33B7FA1DFFC7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopOnContainers.WebMVC", "src\Web\WebMVC\eShopOnContainers.WebMVC.xproj", "{F0333D8E-0B27-42B7-B2C6-78F3657624E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Release|Any CPU.Build.0 = Release|Any CPU
{2110CBB0-3B38-4EE4-A743-DF6968D80D90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2110CBB0-3B38-4EE4-A743-DF6968D80D90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2110CBB0-3B38-4EE4-A743-DF6968D80D90}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -87,6 +83,10 @@ Global
{C10C7B69-CE4F-4167-928E-33B7FA1DFFC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C10C7B69-CE4F-4167-928E-33B7FA1DFFC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C10C7B69-CE4F-4167-928E-33B7FA1DFFC7}.Release|Any CPU.Build.0 = Release|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -98,7 +98,6 @@ Global
{326A7FB3-5295-468C-A4FE-67DCB823E1E5} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
{BF3EF4F3-E4F5-41DA-9D2D-57223687D1A8} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
{0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
{F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
{2110CBB0-3B38-4EE4-A743-DF6968D80D90} = {BF3EF4F3-E4F5-41DA-9D2D-57223687D1A8}
{42681D9D-750A-4DF7-BD9F-9292CFD5C253} = {326A7FB3-5295-468C-A4FE-67DCB823E1E5}
{231226CE-690B-4979-8870-9A79D80928E2} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
@ -108,5 +107,6 @@ Global
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967} = {EF0337F2-ED00-4643-89FD-EE10863F1870}
{48FC45C5-223F-4B59-AC77-6CBB1C561E85} = {932D8224-11F6-4D07-B109-DA28AD288A63}
{C10C7B69-CE4F-4167-928E-33B7FA1DFFC7} = {48FC45C5-223F-4B59-AC77-6CBB1C561E85}
{F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
EndGlobalSection
EndGlobal

View File

@ -1,7 +0,0 @@
FROM microsoft/dotnet:1.0.0-core
ARG source=.
WORKDIR /app
ENV ASPNETCORE_URLS http://*:80
EXPOSE 80
COPY $source .
ENTRYPOINT dotnet Microsoft.eShopOnContainers.WebMVC.dll

View File

@ -1,10 +0,0 @@
version: '2'
services:
microsoft.eshoponcontainers.webmvc:
image: user/microsoft.eshoponcontainers.webmvc${TAG}
build:
context: .
dockerfile: Dockerfile
ports:
- "80"

View File

@ -0,0 +1,2 @@
docker-compose.yml
Dockerfile

View File

@ -0,0 +1,8 @@
FROM microsoft/aspnetcore:1.0.1
ENTRYPOINT ["dotnet", "WebMVC.dll"]
ARG source=.
WORKDIR /app
ENV ASPNETCORE_URLS http://*:80
EXPOSE 80
COPY $source .

View File

@ -1,7 +1,7 @@
version: '2'
services:
microsoft.eshoponcontainers.webmvc:
webmvc:
build:
args:
source: obj/Docker/empty/

View File

@ -1,7 +1,7 @@
version: '2'
services:
microsoft.eshoponcontainers.webmvc:
webmvc:
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
volumes:

View File

@ -0,0 +1,42 @@
version: '2'
services:
webmvc:
image: eshop/web${TAG}
build:
context: .
dockerfile: Dockerfile
environment:
- CatalogUrl=http://catalog.api
ports:
- "80:80"
depends_on:
- catalog.api
catalog.api:
image: eshop/catalog.api
environment:
- ConnectionString=Server=catalogdata;Port=5432;Database=postgres;username=postgres
expose:
- "80"
depends_on:
- catalogdata
catalogdata:
image: glennc/eshopdata
ordering.api:
image: eshop/ordering.api
environment:
- ConnectionString=Server=ordering.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
ports:
- "81:80"
extra_hosts:
- "CESARDLBOOKVHD:10.0.75.1"
depends_on:
- ordering.data
ordering.data:
image: eshop/ordering.data.sqlserver.linux
ports:
- "1433:1433"

View File

@ -77,7 +77,9 @@
"Areas/**/Views",
"appsettings.json",
"web.config",
"Dockerfile"
"Dockerfile",
"docker-compose.yml",
".dockerignore"
]
},
"scripts": {
@ -86,7 +88,6 @@
"dotnet bundle"
],
"postpublish": [
//"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
]
/*"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"*/]
}
}

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show More