You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
3.4 KiB

8 years ago
  1. # Containerized eShop
  2. Sample reference containerized application, cross-platform and microservices architecture.
  3. Powered by Microsoft
  4. <img src="img/eshop_cover.png">
  5. #Overview
  6. 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>.
  7. #Tools
  8. #### Windows
  9. <a href='https://github.com/docker/toolbox/releases/download/v1.12.3/DockerToolbox-1.12.3.exe'>Docker tools for windows</a>
  10. ####Mac
  11. <a href='https://github.com/docker/toolbox/releases/download/v1.12.3/DockerToolbox-1.12.3.pkg'>Docker tools for Mac</a>
  12. ##Set up Cpu and Memory
  13. 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:
  14. <img src="img/docker_settings.png">
  15. #Demo
  16. 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.
  17. 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.
  18. SPA Application: Developed with Angular2, Typescript and Mvc 6, is another different aproach in web on how to work in a Microservices oriented solution.
  19. 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.
  20. #Deploy goblal
  21. In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure. The steps:
  22. - <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.
  23. - <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`
  24. #Run
  25. Once the deploy process of docker-compose finishes you have to be able to access the services in this urls from your machine:
  26. - Web: http://localhost:5100
  27. - Web Spa: http://localhost:5104
  28. - Catalog service: http://localhost:5101
  29. - Orders service: http://localhost:5102
  30. - Basket service: http://localhost:5103
  31. - Identity service: http://localhost:5105
  32. - Orders data (SQL Server): Server=tcp:localhost,5432;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;
  33. - Catalog data (SQL Server): Server=tcp:localhost,5434;Database=CatalogDB;User Id=sa;Password=Pass@word
  34. - Identity data (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
  35. - Basket data (Redis): listening in localhost:6379
  36. #Deploy individiual services into docker
  37. 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.