@ -1,3 +1,57 @@ | |||||
# Containerized eShop | # Containerized eShop | ||||
Sample reference containerized application, cross-platform and microservices architecture. | Sample reference containerized application, cross-platform and microservices architecture. | ||||
Powered by .NET Core, Docker and Docker Swarm mode | |||||
Powered by Microsoft | |||||
<img src="img/eshop_cover.png"> | |||||
#Overview | |||||
In this repo you will fin samples that will help you to get introduced into <b>.net core</b>, microservices environment and <b>docker</b>. | |||||
#Tools | |||||
#### Windows | |||||
<a href='https://github.com/docker/toolbox/releases/download/v1.12.3/DockerToolbox-1.12.3.exe'>Docker tools for windows</a> | |||||
####Mac | |||||
<a href='https://github.com/docker/toolbox/releases/download/v1.12.3/DockerToolbox-1.12.3.pkg'>Docker tools for Mac</a> | |||||
##Set up Cpu and Memory | |||||
In this demo we will run 3 instances of SQL Server, 6 asp.net core applications and 1 redis server it's important to set up properly the Cpu and Ram assigned to docker. This can be set, once installed docker in your device through the whale icon, right click, settings and in the Advanced option you will need to adjust the default to the new values shown in the image: | |||||
<img src="img/docker_settings.png"> | |||||
#Demo | |||||
The demo scenario is based on a ecommerce shop, each service is a .net core web application (basket, catalog, ordering, identity) and this services are consumed by differents web and mobile applications. | |||||
MVC Application: Its an Mvc 6 development where you can find good samples about how to work with microservices in a MVC asp.net core application. | |||||
SPA Application: Developed with Angular2, Typescript and Mvc 6, is another different aproach in web on how to work in a Microservices oriented solution. | |||||
Xamarin Application (Ios, Windows, Android): Its a client application that run in mobile devices (ios, android, windows) and you can find another example on how to build a microservices oriented application. | |||||
#Deploy goblal | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. The steps: | |||||
- <a href='build-images.ps1'>build-images.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool <u>pointing to the root directory of the solution</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls from your machine: | |||||
- Web: http://localhost:5100 | |||||
- Web Spa: http://localhost:5104 | |||||
- Catalog service: http://localhost:5101 | |||||
- Orders service: http://localhost:5102 | |||||
- Basket service: http://localhost:5103 | |||||
- Identity service: http://localhost:5105 | |||||
- Orders data (SQL Server): Server=tcp:localhost,5432;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word; | |||||
- Catalog data (SQL Server): Server=tcp:localhost,5434;Database=CatalogDB;User Id=sa;Password=Pass@word | |||||
- Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word | |||||
- Basket data (Redis): listening in localhost:6379 | |||||
#Deploy individiual services into docker | |||||
Under each project root you will find a readme.md file as this that describes how to run and deploy the service individually into a docker container. | |||||
@ -0,0 +1,19 @@ | |||||
param([switch]$Elevated) | |||||
function Check-Admin { | |||||
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) | |||||
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) | |||||
} | |||||
if ((Check-Admin) -eq $false) { | |||||
if ($elevated) | |||||
{ | |||||
# could not elevate, quit | |||||
} | |||||
else { | |||||
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) | |||||
} | |||||
exit | |||||
} | |||||
ac -Encoding UTF8 C:\Windows\system32\drivers\etc\hosts "127.0.0.1 identity.service" |
@ -0,0 +1,16 @@ | |||||
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path | |||||
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow | |||||
#*** Basket service image *** | |||||
$basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json" | |||||
Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow | |||||
$basketPathToPub = $scriptPath + "\pub\basket" | |||||
Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $basketPathToJson | |||||
dotnet build $basketPathToJson | |||||
dotnet publish $basketPathToJson -o $basketPathToPub | |||||
docker build -t eshop/basket.api $basketPathToPub |
@ -0,0 +1,16 @@ | |||||
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path | |||||
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow | |||||
#*** Catalog service image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $catalogPathToJson | |||||
dotnet build $catalogPathToJson | |||||
dotnet publish $catalogPathToJson -o $catalogPathToPub | |||||
docker build -t eshop/catalog.api $catalogPathToPub |
@ -0,0 +1,16 @@ | |||||
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path | |||||
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow | |||||
# *** identitySvc image *** | |||||
$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json" | |||||
Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow | |||||
$identitySvcPathToPub = $scriptPath + "\pub\identity" | |||||
Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $identitySvcPathToJson | |||||
dotnet build $identitySvcPathToJson | |||||
dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub | |||||
docker build -t eshop/identity $identitySvcPathToPub |
@ -0,0 +1,16 @@ | |||||
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path | |||||
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow | |||||
#*** Ordering service image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $orderingPathToJson | |||||
dotnet build $orderingPathToJson | |||||
dotnet publish $orderingPathToJson -o $orderingPathToPub | |||||
docker build -t eshop/ordering.api $orderingPathToPub |
@ -0,0 +1,77 @@ | |||||
$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 | |||||
# *** WebSPA image *** | |||||
$webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json" | |||||
Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow | |||||
$webSPAPathToPub = $scriptPath + "\pub\webSPA" | |||||
$webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat" | |||||
Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $webSPAPathToJson | |||||
dotnet build $webSPAPathToJson | |||||
# Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat | |||||
dotnet publish $webSPAPathToJson -o $webSPAPathToPub | |||||
# *** identitySvc image *** | |||||
$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json" | |||||
Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow | |||||
$identitySvcPathToPub = $scriptPath + "\pub\identity" | |||||
Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $identitySvcPathToJson | |||||
dotnet build $identitySvcPathToJson | |||||
dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub | |||||
#*** Catalog service image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $catalogPathToJson | |||||
dotnet build $catalogPathToJson | |||||
dotnet publish $catalogPathToJson -o $catalogPathToPub | |||||
#*** Ordering service image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $orderingPathToJson | |||||
dotnet build $orderingPathToJson | |||||
dotnet publish $orderingPathToJson -o $orderingPathToPub | |||||
#*** Basket service image *** | |||||
$basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json" | |||||
Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow | |||||
$basketPathToPub = $scriptPath + "\pub\basket" | |||||
Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $basketPathToJson | |||||
dotnet build $basketPathToJson | |||||
dotnet publish $basketPathToJson -o $basketPathToPub | |||||
#!/bin/bash | |||||
# Delete all containers | |||||
docker rm $(docker ps -a -q) -f | |||||
# Delete all images | |||||
docker rmi $(docker images -q) | |||||
#*** build docker images *** | |||||
docker build -t eshop/catalog.api $catalogPathToPub | |||||
docker build -t eshop/ordering.api $orderingPathToPub | |||||
docker build -t eshop/basket.api $basketPathToPub | |||||
docker build -t eshop/webspa $webSPAPathToPub | |||||
docker build -t eshop/identity $identitySvcPathToPub |
@ -0,0 +1,75 @@ | |||||
$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 | |||||
# *** WebMVC image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $webPathToJson | |||||
dotnet build $webPathToJson | |||||
dotnet publish $webPathToJson -o $webPathToPub | |||||
# *** identitySvc image *** | |||||
$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json" | |||||
Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow | |||||
$identitySvcPathToPub = $scriptPath + "\pub\identity" | |||||
Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $identitySvcPathToJson | |||||
dotnet build $identitySvcPathToJson | |||||
dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub | |||||
#*** Catalog service image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $catalogPathToJson | |||||
dotnet build $catalogPathToJson | |||||
dotnet publish $catalogPathToJson -o $catalogPathToPub | |||||
#*** Ordering service image *** | |||||
$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 | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $orderingPathToJson | |||||
dotnet build $orderingPathToJson | |||||
dotnet publish $orderingPathToJson -o $orderingPathToPub | |||||
#*** Basket service image *** | |||||
$basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json" | |||||
Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow | |||||
$basketPathToPub = $scriptPath + "\pub\basket" | |||||
Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow | |||||
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue | |||||
dotnet restore $basketPathToJson | |||||
dotnet build $basketPathToJson | |||||
dotnet publish $basketPathToJson -o $basketPathToPub | |||||
#!/bin/bash | |||||
# Delete all containers | |||||
docker rm $(docker ps -a -q) -f | |||||
# Delete all images | |||||
docker rmi $(docker images -q) | |||||
#*** build docker images *** | |||||
docker build -t eshop/web $webPathToPub | |||||
docker build -t eshop/catalog.api $catalogPathToPub | |||||
docker build -t eshop/ordering.api $orderingPathToPub | |||||
docker build -t eshop/basket.api $basketPathToPub | |||||
docker build -t eshop/identity $identitySvcPathToPub |
@ -1,4 +0,0 @@ | |||||
docker push eshop/web | |||||
docker push eshop/catalog.api | |||||
docker push eshop/ordering.api |
@ -1,187 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"> | |||||
<head> | |||||
<meta charset="utf-8" /> | |||||
<title>Welcome to ASP.NET Core</title> | |||||
<style> | |||||
html { | |||||
background: #f1f1f1; | |||||
height: 100%; | |||||
} | |||||
body { | |||||
background: #fff; | |||||
color: #505050; | |||||
font: 14px 'Segoe UI', tahoma, arial, helvetica, sans-serif; | |||||
margin: 1%; | |||||
min-height: 95.5%; | |||||
border: 1px solid silver; | |||||
position: relative; | |||||
} | |||||
#header { | |||||
padding: 0; | |||||
} | |||||
#header h1 { | |||||
font-size: 44px; | |||||
font-weight: normal; | |||||
margin: 0; | |||||
padding: 10px 30px 10px 30px; | |||||
} | |||||
#header span { | |||||
margin: 0; | |||||
padding: 0 30px; | |||||
display: block; | |||||
} | |||||
#header p { | |||||
font-size: 20px; | |||||
color: #fff; | |||||
background: #007acc; | |||||
padding: 0 30px; | |||||
line-height: 50px; | |||||
margin-top: 25px; | |||||
} | |||||
#header p a { | |||||
color: #fff; | |||||
text-decoration: underline; | |||||
font-weight: bold; | |||||
padding-right: 35px; | |||||
background: no-repeat right bottom url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAWCAMAAAAcqPc3AAAANlBMVEUAAAAAeswfitI9mthXp91us+KCvuaTx+mjz+2x1u+83PLH4vTR5/ba7Pjj8Pns9fv1+v3////wy3dWAAAAAXRSTlMAQObYZgAAAHxJREFUeNp9kVcSwCAIRMHUYoH7XzaxOxJ9P8oyQ1uIqNPwh3s2aLmIM2YtqrLcQIeQEylhuCeUOlhgve5yoBCfWmlnlgkN4H8ykbpaE7gR03AbUHiwoOxUH9Xp+ubd41p1HF3mBPrfC87BHeTdaB3ceeKL9HGpcvX9zu6+DdMWT9KQPvYAAAAASUVORK5CYII=); | |||||
} | |||||
#main { | |||||
padding: 5px 30px; | |||||
clear: both; | |||||
} | |||||
.section { | |||||
width: 21.7%; | |||||
float: left; | |||||
margin: 0 0 0 4%; | |||||
} | |||||
.section h2 { | |||||
font-size: 13px; | |||||
text-transform: uppercase; | |||||
margin: 0; | |||||
border-bottom: 1px solid silver; | |||||
padding-bottom: 12px; | |||||
margin-bottom: 8px; | |||||
} | |||||
.section.first { | |||||
margin-left: 0; | |||||
} | |||||
.section.first h2 { | |||||
font-size: 24px; | |||||
text-transform: none; | |||||
margin-bottom: 25px; | |||||
border: none; | |||||
} | |||||
.section.first li { | |||||
border-top: 1px solid silver; | |||||
padding: 8px 0; | |||||
} | |||||
.section.last { | |||||
margin-right: 0; | |||||
} | |||||
ul { | |||||
list-style: none; | |||||
padding: 0; | |||||
margin: 0; | |||||
line-height: 20px; | |||||
} | |||||
li { | |||||
padding: 4px 0; | |||||
} | |||||
a { | |||||
color: #267cb2; | |||||
text-decoration: none; | |||||
} | |||||
a:hover { | |||||
text-decoration: underline; | |||||
} | |||||
#footer { | |||||
clear: both; | |||||
padding-top: 50px; | |||||
} | |||||
#footer p { | |||||
position: absolute; | |||||
bottom: 10px; | |||||
} | |||||
</style> | |||||
</head> | |||||
<body> | |||||
<div id="header"> | |||||
<h1>Welcome to ASP.NET Core</h1> | |||||
<span> | |||||
We've made some big updates in this release, so it’s <b>important</b> that you spend | |||||
a few minutes to learn what’s new. | |||||
</span> | |||||
<p>You've created a new ASP.NET Core project. <a href="http://go.microsoft.com/fwlink/?LinkId=518016">Learn what's new</a></p> | |||||
</div> | |||||
<div id="main"> | |||||
<div class="section first"> | |||||
<h2>This application consists of:</h2> | |||||
<ul> | |||||
<li>Sample pages using ASP.NET Core MVC</li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | |||||
<li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | |||||
</ul> | |||||
</div> | |||||
<div class="section"> | |||||
<h2>How to</h2> | |||||
<ul> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | |||||
</ul> | |||||
</div> | |||||
<div class="section"> | |||||
<h2>Overview</h2> | |||||
<ul> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | |||||
</ul> | |||||
</div> | |||||
<div class="section last"> | |||||
<h2>Run & Deploy</h2> | |||||
<ul> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | |||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li> | |||||
</ul> | |||||
</div> | |||||
<div id="footer"> | |||||
<p>We would love to hear your <a href="http://go.microsoft.com/fwlink/?LinkId=518015">feedback</a></p> | |||||
</div> | |||||
</div> | |||||
</body> | |||||
</html> |
@ -0,0 +1,24 @@ | |||||
# Containerized eShop - Basket Service | |||||
Sample reference containerized application, cross-platform and microservices architecture. | |||||
Powered by Microsoft | |||||
#Overview | |||||
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. | |||||
#Deploy | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. | |||||
- <a href='build-image-services-basket.ps1'>build-image-services-basket.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls: | |||||
- Basket service: http://localhost:5103 | |||||
- Identity service: http://localhost:5105 | |||||
- Basket data (Redis): listening in localhost:6379 | |||||
- Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word | |||||
@ -1,17 +0,0 @@ | |||||
version: '2' | |||||
services: | |||||
basket.api: | |||||
build: | |||||
args: | |||||
source: obj/Docker/empty/ | |||||
labels: | |||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux" | |||||
environment: | |||||
- ASPNETCORE_ENVIRONMENT=Development | |||||
- DOTNET_USE_POLLING_FILE_WATCHER=1 | |||||
volumes: | |||||
- .:/app | |||||
- ~/.nuget/packages:/root/.nuget/packages:ro | |||||
- ~/clrdbg:/clrdbg:ro | |||||
entrypoint: tail -f /dev/null |
@ -1,9 +0,0 @@ | |||||
version: '2' | |||||
services: | |||||
basket.api: | |||||
labels: | |||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux" | |||||
volumes: | |||||
- ~/clrdbg:/clrdbg:ro | |||||
entrypoint: tail -f /dev/null |
@ -0,0 +1,19 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.AspNetCore.Mvc; | |||||
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 | |||||
namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers | |||||
{ | |||||
public class HomeController : Controller | |||||
{ | |||||
// GET: /<controller>/ | |||||
public IActionResult Index() | |||||
{ | |||||
return new RedirectResult("~/swagger/ui"); | |||||
} | |||||
} | |||||
} |
@ -1,5 +1,5 @@ | |||||
FROM microsoft/aspnetcore:latest | |||||
FROM microsoft/aspnetcore:1.0.1 | |||||
WORKDIR /app | WORKDIR /app | ||||
EXPOSE 80 | EXPOSE 80 | ||||
ADD . /app | |||||
COPY . /app | |||||
ENTRYPOINT dotnet Catalog.API.dll | ENTRYPOINT dotnet Catalog.API.dll |
@ -0,0 +1,21 @@ | |||||
# Containerized eShop - Catalog Service | |||||
Sample reference containerized application, cross-platform and microservices architecture. | |||||
Powered by Microsoft | |||||
#Overview | |||||
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. | |||||
#Deploy | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. | |||||
- <a href='build-image-services-catalog.ps1'>build-image-services-catalog.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls: | |||||
- Catalog service: http://localhost:5101 | |||||
- Catalog data (SQL Server): Server=tcp:localhost,5434;Database=CatalogDB;User Id=sa;Password=Pass@word | |||||
@ -1,12 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace eShopOnContainers.Identity.Configuration | |||||
{ | |||||
public class ClientCallBackUrls | |||||
{ | |||||
public string Spa { get; set; } | |||||
} | |||||
} |
@ -0,0 +1,25 @@ | |||||
# Containerized eShop - Identity Service | |||||
Sample reference containerized application, cross-platform and microservices architecture. | |||||
Powered by Microsoft | |||||
#Overview | |||||
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. | |||||
#Considerations | |||||
This service is a identity provider implemented with identity server 4, to implement this scenario is needed a public authority so to complete this flow in our local docker infrastructure we have to add a entry in our host file (windows) or equivalent in other platforms: | |||||
identity.service 127.0.0.1 | |||||
In the root directory of this solution you'll find add-host.ps1 script that does this work for you (requires elevation permission). | |||||
#Deploy | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. | |||||
- <a href='build-image-services-identity.ps1'>build-image-services-identity.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls: | |||||
- Identity service: http://localhost:5105 | |||||
- Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word |
@ -1,49 +0,0 @@ | |||||
@*@model eShopOnContainers.Identity.Models.AccountViewModels.LoginViewModel | |||||
<div class="login-page"> | |||||
<div class="page-header"> | |||||
<h1>Login</h1> | |||||
</div> | |||||
@Html.Partial("_ValidationSummary") | |||||
<div class="row"> | |||||
@if (Model.EnableLocalLogin) | |||||
{ | |||||
<div class="col-sm-6"> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title">Local Login</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<form asp-route="Login"> | |||||
<input type="hidden" asp-for="ReturnUrl" /> | |||||
<fieldset> | |||||
<div class="form-group"> | |||||
<label asp-for="Username"></label> | |||||
<input class="form-control" placeholder="Username" asp-for="Username" autofocus> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label asp-for="Password"></label> | |||||
<input type="password" class="form-control" placeholder="Password" asp-for="Password" autocomplete="off"> | |||||
</div> | |||||
<div class="form-group login-remember"> | |||||
<label asp-for="RememberLogin"> | |||||
<input asp-for="RememberLogin"> | |||||
<strong>Remember My Login</strong> | |||||
</label> | |||||
</div> | |||||
<div class="form-group"> | |||||
<button class="btn btn-primary">Login</button> | |||||
</div> | |||||
</fieldset> | |||||
</form> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
} | |||||
</div> | |||||
</div>*@ |
@ -1 +0,0 @@ | |||||
|
@ -0,0 +1 @@ | |||||
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 32 32" height="32px" id="Слой_1" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path clip-rule="evenodd" d="M21.698,15.286l-9.002-8.999 c-0.395-0.394-1.035-0.394-1.431,0c-0.395,0.394-0.395,1.034,0,1.428L19.553,16l-8.287,8.285c-0.395,0.394-0.395,1.034,0,1.429 c0.395,0.394,1.036,0.394,1.431,0l9.002-8.999C22.088,16.325,22.088,15.675,21.698,15.286z" fill="#FFFFFF" fill-rule="evenodd" id="Chevron_Right"/><g/><g/><g/><g/><g/><g/></svg> |
@ -0,0 +1,44 @@ | |||||
<?xml version="1.0" encoding="iso-8859-1"?> | |||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> | |||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | |||||
viewBox="0 0 259.244 259.244" style="enable-background:new 0 0 259.244 259.244;" xml:space="preserve"> | |||||
<g> | |||||
<path style="fill:#3DB39E;" d="M248.348,129.3h-15.849C232.41,65.277,180.831,13.394,117.202,13.394 | |||||
c-31.841,0-60.661,12.998-81.534,33.996C14.017,68.549,0.25,97.092,0.036,129.3H0l0.018,0.331L0,130.033h0.036 | |||||
c0.393,63.853,51.758,115.816,115.19,115.816c31.841,0,60.661-13.007,81.534-34.049l-25.852-24.931 | |||||
c-14.178,14.303-34.058,23.027-55.682,23.135c-44.401,0.206-79.201-36.49-79.201-80.122c-0.107-22.893,10.092-42.908,25.486-57.595 | |||||
c14.186-14.285,34.058-23.001,55.691-23.108c44.41-0.206,79.201,36.445,79.201,79.997v0.125h-15.661 | |||||
c-9.708,0-13.668,6.499-8.814,14.41l33.799,33.433c7.732,7.732,9.967,7.661,17.646,0l33.799-33.433 | |||||
C262.025,135.781,258.056,129.3,248.348,129.3z"/> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
<g> | |||||
</g> | |||||
</svg> |
@ -0,0 +1,19 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.AspNetCore.Mvc; | |||||
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 | |||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers | |||||
{ | |||||
public class HomeController : Controller | |||||
{ | |||||
// GET: /<controller>/ | |||||
public IActionResult Index() | |||||
{ | |||||
return new RedirectResult("~/swagger/ui"); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,26 @@ | |||||
# Containerized eShop - Orders Service | |||||
Sample reference containerized application, cross-platform and microservices architecture. | |||||
Powered by Microsoft | |||||
#Overview | |||||
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. | |||||
#Deploy | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. | |||||
- <a href='build-image-services-orders.ps1'>build-image-services-orders.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls: | |||||
- Orders service: http://localhost:5102 | |||||
- Identity service: http://localhost:5105 | |||||
- Orders data (SQL Server): Server=tcp:localhost,5432;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word; | |||||
- Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word | |||||
@ -1,17 +0,0 @@ | |||||
version: '2' | |||||
services: | |||||
ordering.api: | |||||
build: | |||||
args: | |||||
source: obj/Docker/empty/ | |||||
labels: | |||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux" | |||||
environment: | |||||
- ASPNETCORE_ENVIRONMENT=Development | |||||
- DOTNET_USE_POLLING_FILE_WATCHER=1 | |||||
volumes: | |||||
- .:/app | |||||
- ~/.nuget/packages:/root/.nuget/packages:ro | |||||
- ~/clrdbg:/clrdbg:ro | |||||
entrypoint: tail -f /dev/null |
@ -1,9 +0,0 @@ | |||||
version: '2' | |||||
services: | |||||
ordering.api: | |||||
labels: | |||||
- "com.microsoft.visualstudio.targetoperatingsystem=linux" | |||||
volumes: | |||||
- ~/clrdbg:/clrdbg:ro | |||||
entrypoint: tail -f /dev/null |
@ -0,0 +1,31 @@ | |||||
# Containerized eShop - Web Mvc | |||||
Sample reference containerized application, cross-platform and microservices architecture. | |||||
Powered by Microsoft | |||||
#Overview | |||||
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. | |||||
#Deploy | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. | |||||
- <a href='build-image-web.ps1'>build-image-web.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls: | |||||
- Web: http://localhost:5100 | |||||
- Catalog service: http://localhost:5101 | |||||
- Orders service: http://localhost:5102 | |||||
- Basket service: http://localhost:5103 | |||||
- Identity service: http://localhost:5105 | |||||
- Orders data (SQL Server): Server=tcp:localhost,5432;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word; | |||||
- Catalog data (SQL Server): Server=tcp:localhost,5434;Database=CatalogDB;User Id=sa;Password=Pass@word | |||||
- Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word | |||||
- Basket data (Redis): listening in localhost:6379 | |||||
@ -0,0 +1,31 @@ | |||||
# Containerized eShop - Web Spa | |||||
Sample reference containerized application, cross-platform and microservices architecture. | |||||
Powered by Microsoft | |||||
#Overview | |||||
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution. | |||||
#Deploy | |||||
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. | |||||
- <a href='build-image-web-spa.ps1'>build-image-web-spa.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications. | |||||
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up` | |||||
#Run | |||||
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls: | |||||
- Web: http://localhost:5104 | |||||
- Catalog service: http://localhost:5101 | |||||
- Orders service: http://localhost:5102 | |||||
- Basket service: http://localhost:5103 | |||||
- Identity service: http://localhost:5105 | |||||
- Orders data (SQL Server): Server=tcp:localhost,5432;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word; | |||||
- Catalog data (SQL Server): Server=tcp:localhost,5434;Database=CatalogDB;User Id=sa;Password=Pass@word | |||||
- Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word | |||||
- Basket data (Redis): listening in localhost:6379 | |||||
@ -1 +0,0 @@ | |||||
npm run build:prod |
@ -1,3 +1,3 @@ | |||||
module.exports = { | module.exports = { | ||||
devtool: 'cheap-module-source-map' | |||||
//devtool: 'cheap-module-source-map' | |||||
}; | }; |