Skip to content

Commit 92777dc

Browse files
Merge branch 'dev' of https://github.com/dotnet/eShopOnContainers into dev
2 parents 85b6575 + 8c57048 commit 92777dc

25 files changed

Lines changed: 931 additions & 9 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#https://github.com/spring2/dockerfiles/tree/master/rabbitmq
2+
3+
FROM microsoft/windowsservercore
4+
5+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
6+
7+
ENV chocolateyUseWindowsCompression false
8+
9+
RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); \
10+
choco install -y curl;
11+
12+
RUN choco install -y erlang
13+
ENV ERLANG_SERVICE_MANAGER_PATH="C:\Program Files\erl8.2\erts-8.2\bin"
14+
RUN choco install -y rabbitmq
15+
ENV RABBITMQ_SERVER="C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5"
16+
17+
ENV RABBITMQ_CONFIG_FILE="c:\rabbitmq"
18+
COPY rabbitmq.config C:/
19+
COPY rabbitmq.config C:/Users/ContainerAdministrator/AppData/Roaming/RabbitMQ/
20+
COPY enabled_plugins C:/Users/ContainerAdministrator/AppData/Roaming/RabbitMQ/
21+
22+
23+
EXPOSE 4369
24+
EXPOSE 5672
25+
EXPOSE 5671
26+
EXPOSE 15672
27+
28+
WORKDIR C:/Program\ Files/RabbitMQ\ Server/rabbitmq_server-3.6.5/sbin
29+
CMD .\rabbitmq-server.bat

_docker/rabbitmq/enabled_plugins

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[rabbitmq_amqp1_0,rabbitmq_management].

_docker/rabbitmq/rabbitmq.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{rabbit, [{loopback_users, []}]}].

_docker/redis/Dockerfile.nanowin

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# The MSI installs a service which is hard to override, so let's use a zip file.
2+
3+
FROM microsoft/windowsservercore
4+
MAINTAINER alexellis2@gmail.com
5+
6+
SHELL ["powershell"]
7+
RUN $ErrorActionPreference = 'Stop'; \
8+
wget https://github.com/MSOpenTech/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip -OutFile Redis-x64-3.2.100.zip ; \
9+
Expand-Archive Redis-x64-3.2.100.zip -dest 'C:\\Program Files\\Redis\\' ; \
10+
Remove-Item Redis-x64-3.2.100.zip -Force
11+
12+
RUN setx PATH '%PATH%;C:\\Program Files\\Redis\\'
13+
WORKDIR 'C:\\Program Files\\Redis\\'
14+
15+
16+
17+
RUN Get-Content redis.windows.conf | Where { $_ -notmatch 'bind 127.0.0.1' } | Set-Content redis.openport.conf ; \
18+
Get-Content redis.openport.conf | Where { $_ -notmatch 'protected-mode yes' } | Set-Content redis.unprotected.conf ; \
19+
Add-Content redis.unprotected.conf 'protected-mode no' ; \
20+
Add-Content redis.unprotected.conf 'bind 0.0.0.0' ; \
21+
Get-Content redis.unprotected.conf
22+
23+
EXPOSE 6379
24+
25+
RUN set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord
26+
27+
# Define our command to be run when launching the container
28+
CMD .\\redis-server.exe .\\redis.unprotected.conf --port 6379 ; \
29+
Write-Host Redis Started... ; \
30+
while ($true) { Start-Sleep -Seconds 3600 }
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: '2.1'
2+
3+
# The default docker-compose.override file can use the "localhost" as the external name for testing web apps within the same dev machine.
4+
# The ESHOP_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like:
5+
# ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost
6+
# but values present in the environment vars at runtime will always override those defined inside the .env file
7+
# An external IP or DNS name has to be used (instead localhost and the 10.0.75.1 IP) when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance.
8+
9+
services:
10+
11+
basket.api:
12+
environment:
13+
- ASPNETCORE_ENVIRONMENT=Development
14+
- ASPNETCORE_URLS=http://0.0.0.0:5103
15+
- ConnectionString=basket.data
16+
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
17+
- EventBusConnection=rabbitmq
18+
ports:
19+
- "5103:5103"
20+
21+
catalog.api:
22+
environment:
23+
- ASPNETCORE_ENVIRONMENT=Development
24+
- ASPNETCORE_URLS=http://0.0.0.0:5101
25+
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
26+
- ExternalCatalogBaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
27+
- EventBusConnection=rabbitmq
28+
ports:
29+
- "5101:5101"
30+
31+
identity.api:
32+
environment:
33+
- ASPNETCORE_ENVIRONMENT=Development
34+
- ASPNETCORE_URLS=http://0.0.0.0:5105
35+
- SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104
36+
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word
37+
- MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5105.
38+
ports:
39+
- "5105:5105"
40+
41+
ordering.api:
42+
environment:
43+
- ASPNETCORE_ENVIRONMENT=Development
44+
- ASPNETCORE_URLS=http://0.0.0.0:5102
45+
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
46+
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
47+
- EventBusConnection=rabbitmq
48+
ports:
49+
- "5102:5102"
50+
51+
webspa:
52+
environment:
53+
- ASPNETCORE_ENVIRONMENT=Development
54+
- ASPNETCORE_URLS=http://0.0.0.0:5104
55+
- CatalogUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5101
56+
- OrderingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102
57+
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
58+
- BasketUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103
59+
ports:
60+
- "5104:5104"
61+
62+
webmvc:
63+
environment:
64+
- ASPNETCORE_ENVIRONMENT=Development
65+
- ASPNETCORE_URLS=http://0.0.0.0:5100
66+
- CatalogUrl=http://catalog.api:5101
67+
- OrderingUrl=http://ordering.api:5102
68+
- BasketUrl=http://basket.api:5103
69+
- IdentityUrl=http://10.0.75.1:5105 #Local: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser.
70+
#Remote: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser.
71+
ports:
72+
- "5100:5100"
73+
74+
sql.data:
75+
environment:
76+
- SA_PASSWORD=Pass@word
77+
- ACCEPT_EULA=Y
78+
ports:
79+
- "5433:1433"

docker-compose-windows.prod.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: '2.1'
2+
3+
# The Production docker-compose file has to have the external/real IPs or DNS names for the services
4+
# The ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like:
5+
# ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=192.168.88.248
6+
# but values present in the environment vars at runtime will always override those defined inside the .env file
7+
# An external IP or DNS name has to be used when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance.
8+
#
9+
# Set ASPNETCORE_ENVIRONMENT=Development to get errors while testing.
10+
#
11+
# You need to start it with the following CLI command:
12+
# docker-compose -f docker-compose-windows.yml -f docker-compose-windows.prod.yml up -d
13+
14+
services:
15+
16+
basket.api:
17+
environment:
18+
- ASPNETCORE_ENVIRONMENT=Production
19+
- ASPNETCORE_URLS=http://0.0.0.0:5103
20+
- ConnectionString=basket.data
21+
- identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
22+
ports:
23+
- "5103:5103"
24+
25+
catalog.api:
26+
environment:
27+
- ASPNETCORE_ENVIRONMENT=Production
28+
- ASPNETCORE_URLS=http://0.0.0.0:5101
29+
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
30+
- ExternalCatalogBaseUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
31+
ports:
32+
- "5101:5101"
33+
34+
identity.api:
35+
environment:
36+
- ASPNETCORE_ENVIRONMENT=Production
37+
- ASPNETCORE_URLS=http://0.0.0.0:5105
38+
- SpaClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5104
39+
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word
40+
- MvcClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105.
41+
ports:
42+
- "5105:5105"
43+
44+
ordering.api:
45+
environment:
46+
- ASPNETCORE_ENVIRONMENT=Production
47+
- ASPNETCORE_URLS=http://0.0.0.0:5102
48+
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
49+
- identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
50+
ports:
51+
- "5102:5102"
52+
53+
webspa:
54+
environment:
55+
- ASPNETCORE_ENVIRONMENT=Production
56+
- ASPNETCORE_URLS=http://0.0.0.0:5104
57+
- CatalogUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101
58+
- OrderingUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5102
59+
- IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
60+
- BasketUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5103
61+
ports:
62+
- "5104:5104"
63+
64+
webmvc:
65+
environment:
66+
- ASPNETCORE_ENVIRONMENT=Production
67+
- ASPNETCORE_URLS=http://0.0.0.0:5100
68+
- CatalogUrl=http://catalog.api:5101
69+
- OrderingUrl=http://ordering.api:5102
70+
- IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
71+
- BasketUrl=http://basket.api:5103
72+
ports:
73+
- "5100:5100"
74+
75+
sql.data:
76+
environment:
77+
- SA_PASSWORD=Pass@word
78+
- ACCEPT_EULA=Y
79+
ports:
80+
- "5433:1433"

docker-compose-windows.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: '2.1'
2+
3+
services:
4+
basket.api:
5+
image: eshop/basket.api
6+
build:
7+
context: ./src/Services/Basket/Basket.API
8+
dockerfile: Dockerfile.nanowin
9+
depends_on:
10+
- basket.data
11+
- identity.api
12+
13+
catalog.api:
14+
image: eshop/catalog.api
15+
build:
16+
context: ./src/Services/Catalog/Catalog.API
17+
dockerfile: Dockerfile.nanowin
18+
depends_on:
19+
- sql.data
20+
21+
identity.api:
22+
image: eshop/identity.api
23+
build:
24+
context: ./src/Services/Identity/Identity.API
25+
dockerfile: Dockerfile.nanowin
26+
depends_on:
27+
- sql.data
28+
29+
ordering.api:
30+
image: eshop/ordering.api
31+
build:
32+
context: ./src/Services/Ordering/Ordering.API
33+
dockerfile: Dockerfile.nanowin
34+
depends_on:
35+
- sql.data
36+
37+
webspa:
38+
image: eshop/webspa
39+
build:
40+
context: ./src/Web/WebSPA
41+
dockerfile: Dockerfile.nanowin
42+
depends_on:
43+
- identity.api
44+
- basket.api
45+
46+
webmvc:
47+
image: eshop/webmvc
48+
build:
49+
context: ./src/Web/WebMVC
50+
dockerfile: Dockerfile.nanowin
51+
depends_on:
52+
- catalog.api
53+
- ordering.api
54+
- identity.api
55+
- basket.api
56+
57+
sql.data:
58+
image: microsoft/mssql-server-windows
59+
60+
basket.data:
61+
image: redis
62+
build:
63+
context: ./_docker/redis
64+
dockerfile: Dockerfile.nanowin
65+
ports:
66+
- "6379:6379"
67+
68+
rabbitmq:
69+
image: rabbitmq
70+
build:
71+
context: ./_docker/rabbitmq
72+
dockerfile: Dockerfile.nanowin
73+
ports:
74+
- "5672:5672"
75+
76+
networks:
77+
default:
78+
external:
79+
name: nat
80+

docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: '2'
88
#
99
# Set ASPNETCORE_ENVIRONMENT=Development to get errors while testing.
1010
#
11-
# You need to start it with the following CLI command:
11+
# You need to start it with the following CLI command:
1212
# docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
1313

1414
services:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM microsoft/dotnet:1.1-runtime-nanoserver
2+
SHELL ["powershell"]
3+
ARG source
4+
WORKDIR /app
5+
RUN set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord
6+
EXPOSE 80
7+
COPY ${source:-obj/Docker/publish} .
8+
ENTRYPOINT ["dotnet", "Basket.API.dll"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM microsoft/dotnet:1.1-runtime-nanoserver
2+
SHELL ["powershell"]
3+
ARG source
4+
WORKDIR /app
5+
RUN set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord
6+
EXPOSE 80
7+
COPY ${source:-obj/Docker/publish} .
8+
ENTRYPOINT ["dotnet", "Catalog.API.dll"]

0 commit comments

Comments
 (0)