Skip to content

Commit d402126

Browse files
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/
1 parent 55c5a99 commit d402126

5 files changed

Lines changed: 103 additions & 70 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ Once the deploy process of docker-compose finishes you should be able to access
110110
- ASP.NET Identity database (SQL Server): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
111111
- Basket data (Redis): listening at localhost:6379
112112

113+
#### Trying the WebMVC application with the DemoUser@microsoft.com user account
114+
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.
115+
The credentials are:
116+
- User: demouser@microsoft.com
117+
- Password: Pass@word1
118+
119+
Below you can see the login page when providing those credentials.
120+
<img src="img/login-demo-user.png">
121+
113122
### Deploying individiual services into docker
114123
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.
115124

docker-compose.override.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#
2+
# docker-compose.override.yml is used to set up local configuration environment
3+
# Things like the external ports to use or secrets/passwords depend on the
4+
# specific deployment environment you might be using.
5+
# Further details and docs: https://docs.docker.com/compose/extends/
6+
#
7+
8+
version: '2'
9+
10+
services:
11+
12+
webmvc:
13+
environment:
14+
- CatalogUrl=http://catalog.api
15+
- OrderingUrl=http://ordering.api:5102
16+
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
17+
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
18+
- BasketUrl=http://basket.api:5103
19+
ports:
20+
- "5100:5100"
21+
22+
webspa:
23+
environment:
24+
- CatalogUrl=http://catalog.api
25+
- OrderingUrl=http://ordering.api
26+
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
27+
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
28+
- BasketUrl=http://basket.api:5103
29+
ports:
30+
- "5104:80"
31+
32+
basket.api:
33+
environment:
34+
- ConnectionString=basket.data
35+
#- identityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
36+
- identityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
37+
ports:
38+
- "5103:5103"
39+
40+
catalog.api:
41+
environment:
42+
- ConnectionString=Server=business.data;Database=CatalogDB;User Id=sa;Password=Pass@word
43+
ports:
44+
- "5101:80"
45+
46+
ordering.api:
47+
environment:
48+
- ConnectionString=Server=business.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
49+
- identityUrl=http://identity.service:5105 #local
50+
#- identityUrl=http://104.40.62.65:5105 #remote
51+
ports:
52+
- "5102:5102"
53+
54+
identity.service:
55+
environment:
56+
- SpaClient=http://localhost:5104
57+
- ConnectionStrings__DefaultConnection=Server=identity.data;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
58+
#- MvcClient=http://104.40.62.65:5100 #Remote: VM Needs to have public access at 5105.
59+
- MvcClient=http://localhost:5100 #Local: You need a entry in windows host file to run identity in local docker.
60+
#10.0.75.1:5105 CCE/TODO: try to avoid host entry.
61+
ports:
62+
- "5105:5105"
63+
64+
identity.data:
65+
environment:
66+
- SA_PASSWORD=Pass@word
67+
- ACCEPT_EULA=Y
68+
ports:
69+
- "5433:1433"
70+
71+
business.data:
72+
environment:
73+
- SA_PASSWORD=Pass@word
74+
- ACCEPT_EULA=Y
75+
ports:
76+
- "5434:1433"

docker-compose.yml

Lines changed: 17 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,50 @@
1+
#
2+
# docker-compose.yml is used to set up the base config per container to be deployed
3+
# Take into account that when deploying, this base configuration is merged with the
4+
# configuration-per-environment specified at the docker-compose.override.yml
5+
# Further details and docs: https://docs.docker.com/compose/extends/
6+
#
17
version: '2'
28

39
services:
410
webmvc:
511
image: eshop/web
6-
build:
7-
context: .
8-
dockerfile: Dockerfile
9-
environment:
10-
- CatalogUrl=http://catalog.api
11-
- OrderingUrl=http://ordering.api:5102
12-
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
13-
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
14-
- BasketUrl=http://basket.api:5103
15-
ports:
16-
- "5100:5100"
1712
depends_on:
1813
- identity.service
1914
- basket.api
2015

2116
webspa:
2217
image: eshop/webspa
23-
build:
24-
context: .
25-
dockerfile: Dockerfile
26-
environment:
27-
- CatalogUrl=http://catalog.api
28-
- OrderingUrl=http://ordering.api
29-
#- IdentityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
30-
- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
31-
- BasketUrl=http://basket.api:5103
32-
ports:
33-
- "5104:80"
3418
depends_on:
3519
- basket.api
3620
- identity.service
3721

38-
identity.service:
39-
image: eshop/identity
40-
environment:
41-
- SpaClient=http://localhost:5104
42-
- ConnectionStrings__DefaultConnection=Server=identity.data;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
43-
#- MvcClient=http://104.40.62.65:5100 #Remote: VM Needs to have public access at 5105.
44-
- MvcClient=http://localhost:5100 #Local: You need a entry in windows host file to run identity in local docker.
45-
#10.0.75.1:5105 CCE/TODO: try to avoid host entry.
46-
ports:
47-
- "5105:5105"
48-
depends_on:
49-
- identity.data
50-
51-
identity.data:
52-
image: microsoft/mssql-server-linux
53-
environment:
54-
- SA_PASSWORD=Pass@word
55-
- ACCEPT_EULA=Y
56-
ports:
57-
- "5433:1433"
58-
5922
basket.api:
6023
image: eshop/basket.api
61-
environment:
62-
- ConnectionString=basket.data
63-
#- identityUrl=http://104.40.62.65:5105 #Remote: VM Needs to have public access at 5105.
64-
- identityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
65-
build:
66-
context: .
67-
dockerfile: Dockerfile
68-
ports:
69-
- "5103:5103"
7024
depends_on:
7125
- basket.data
7226
- identity.service
7327

74-
basket.data:
75-
image: redis
76-
7728
catalog.api:
7829
image: eshop/catalog.api
79-
environment:
80-
- ConnectionString=Server=business.data;Database=CatalogDB;User Id=sa;Password=Pass@word
81-
ports:
82-
- "5101:80"
8330
depends_on:
8431
- business.data
8532

8633
ordering.api:
8734
image: eshop/ordering.api
88-
environment:
89-
- ConnectionString=Server=business.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
90-
- identityUrl=http://identity.service:5105 #local
91-
#- identityUrl=http://104.40.62.65:5105 #remote
92-
ports:
93-
- "5102:5102"
9435
depends_on:
9536
- business.data
9637

38+
identity.service:
39+
image: eshop/identity
40+
depends_on:
41+
- identity.data
42+
43+
identity.data:
44+
image: microsoft/mssql-server-linux
45+
9746
business.data:
9847
image: microsoft/mssql-server-linux
99-
environment:
100-
- SA_PASSWORD=Pass@word
101-
- ACCEPT_EULA=Y
102-
ports:
103-
- "5434:1433"
48+
49+
basket.data:
50+
image: redis

eShopOnContainers-ServicesAndWebApps.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AF739CD-81D8-428D-A08A-0A58372DEBF6}"
99
ProjectSection(SolutionItems) = preProject
10+
docker-compose.override.yml = docker-compose.override.yml
1011
docker-compose.yml = docker-compose.yml
1112
global.json = global.json
1213
NuGet.config = NuGet.config

img/login-demo-user.png

94.5 KB
Loading

0 commit comments

Comments
 (0)