Browse Source

Docker Compose configuration is now split between the docker-compose.yml for base configuration that will always be used that way, and the docker-compose.override.yml config which has configuration depending on the deployment environment, like external ports (out of Docker Host) or any external UR or secret, like connection strings or SQL passwords. For more info, see: https://docs.docker.com/compose/extends/

pull/49/merge
CESARDELATORRE 8 years ago
parent
commit
d402126474
5 changed files with 103 additions and 70 deletions
  1. +9
    -0
      README.md
  2. +76
    -0
      docker-compose.override.yml
  3. +17
    -70
      docker-compose.yml
  4. +1
    -0
      eShopOnContainers-ServicesAndWebApps.sln
  5. BIN
      img/login-demo-user.png

+ 9
- 0
README.md View File

@ -110,6 +110,15 @@ Once the deploy process of docker-compose finishes you should be able to access
- ASP.NET Identity database (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
- Basket data (Redis): listening at localhost:6379
#### Trying the WebMVC application with the DemoUser@microsoft.com user account
When you try the WebMVC application by using the url •Web MVC: http://localhost:5100, you'll be able to test the home page which is also the catalog page. But when trying to add any article to the basket you will get redirected to the login page which is handled by the STS microservice (Security Token Service). At this point, you could register your own user/customer or you can also use the a convenient default user/customer named DemoUser@microsoft.com so you don't need to register and it'll be faster.
The credentials are:
- User: demouser@microsoft.com
- Password: Pass@word1
Below you can see the login page when providing those credentials.
<img src="img/login-demo-user.png">
### Deploying individiual services into docker
Under each project root you will find a readme.md file which describes how to run and deploy the service individually into a docker host.


+ 76
- 0
docker-compose.override.yml View File

@ -0,0 +1,76 @@
#
# docker-compose.override.yml is used to set up local configuration environment
# Things like the external ports to use or secrets/passwords depend on the
# specific deployment environment you might be using.
# Further details and docs: https://docs.docker.com/compose/extends/
#
version: '2'
services:
webmvc:
environment:
- CatalogUrl=http://catalog.api
- OrderingUrl=http://ordering.api:5102
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
- BasketUrl=http://basket.api:5103
ports:
- "5100:5100"
webspa:
environment:
- CatalogUrl=http://catalog.api
- OrderingUrl=http://ordering.api
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
- BasketUrl=http://basket.api:5103
ports:
- "5104:80"
basket.api:
environment:
- ConnectionString=basket.data
#- identityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
- identityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
ports:
- "5103:5103"
catalog.api:
environment:
- ConnectionString=Server=business.data;Database=CatalogDB;User Id=sa;Password=Pass@word
ports:
- "5101:80"
ordering.api:
environment:
- ConnectionString=Server=business.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
- identityUrl=http://identity.service:5105 #local
#- identityUrl=http://104.40.62.65:5105 #remote
ports:
- "5102:5102"
identity.service:
environment:
- SpaClient=http://localhost:5104
- ConnectionStrings__DefaultConnection=Server=identity.data;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
#- MvcClient=http://104.40.62.65:5100 #Remote: VM Needs to have public access at 5105.
- MvcClient=http://localhost:5100 #Local: You need a entry in windows host file to run identity in local docker.
#10.0.75.1:5105 CCE/TODO: try to avoid host entry.
ports:
- "5105:5105"
identity.data:
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433"
business.data:
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5434:1433"

+ 17
- 70
docker-compose.yml View File

@ -1,103 +1,50 @@
#
# docker-compose.yml is used to set up the base config per container to be deployed
# Take into account that when deploying, this base configuration is merged with the
# configuration-per-environment specified at the docker-compose.override.yml
# Further details and docs: https://docs.docker.com/compose/extends/
#
version: '2'
services:
webmvc:
image: eshop/web
build:
context: .
dockerfile: Dockerfile
environment:
- CatalogUrl=http://catalog.api
- OrderingUrl=http://ordering.api:5102
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
- BasketUrl=http://basket.api:5103
ports:
- "5100:5100"
depends_on:
- identity.service
- basket.api
webspa:
image: eshop/webspa
build:
context: .
dockerfile: Dockerfile
environment:
- CatalogUrl=http://catalog.api
- OrderingUrl=http://ordering.api
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
- BasketUrl=http://basket.api:5103
ports:
- "5104:80"
depends_on:
- basket.api
- identity.service
identity.service:
image: eshop/identity
environment:
- SpaClient=http://localhost:5104
- ConnectionStrings__DefaultConnection=Server=identity.data;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
#- MvcClient=http://104.40.62.65:5100 #Remote: VM Needs to have public access at 5105.
- MvcClient=http://localhost:5100 #Local: You need a entry in windows host file to run identity in local docker.
#10.0.75.1:5105 CCE/TODO: try to avoid host entry.
ports:
- "5105:5105"
depends_on:
- identity.data
identity.data:
image: microsoft/mssql-server-linux
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433"
basket.api:
image: eshop/basket.api
environment:
- ConnectionString=basket.data
#- identityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
- identityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
build:
context: .
dockerfile: Dockerfile
ports:
- "5103:5103"
depends_on:
- basket.data
- identity.service
basket.data:
image: redis
catalog.api:
image: eshop/catalog.api
environment:
- ConnectionString=Server=business.data;Database=CatalogDB;User Id=sa;Password=Pass@word
ports:
- "5101:80"
depends_on:
- business.data
ordering.api:
image: eshop/ordering.api
environment:
- ConnectionString=Server=business.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
- identityUrl=http://identity.service:5105 #local
#- identityUrl=http://104.40.62.65:5105 #remote
ports:
- "5102:5102"
depends_on:
- business.data
identity.service:
image: eshop/identity
depends_on:
- identity.data
identity.data:
image: microsoft/mssql-server-linux
business.data:
image: microsoft/mssql-server-linux
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5434:1433"
basket.data:
image: redis

+ 1
- 0
eShopOnContainers-ServicesAndWebApps.sln View File

@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AF739CD-81D8-428D-A08A-0A58372DEBF6}"
ProjectSection(SolutionItems) = preProject
docker-compose.override.yml = docker-compose.override.yml
docker-compose.yml = docker-compose.yml
global.json = global.json
NuGet.config = NuGet.config


BIN
img/login-demo-user.png View File

Before After
Width: 1925  |  Height: 1416  |  Size: 94 KiB

Loading…
Cancel
Save