From 16cae13dc400168a5f61598e6b02ab988641d950 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Mon, 2 Jul 2018 13:37:49 +0100 Subject: [PATCH 1/3] Organize Dockerfiles to be easier to compare --- docker-compose.override.yml | 204 ++++++++++++++++++------------------ docker-compose.windows.yml | 30 +++--- docker-compose.yml | 9 +- 3 files changed, 121 insertions(+), 122 deletions(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index dcdaff236..969cfb922 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -7,7 +7,46 @@ version: '3.4' # 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. services: - + sql.data: + environment: + - SA_PASSWORD=Pass@word + - ACCEPT_EULA=Y + ports: + - "5433:1433" # Important: In a production environment your should remove the external port + + nosql.data: + ports: + - "27017:27017" # Important: In a production environment your should remove the external port + + basket.data: + ports: + - "6379:6379" # Important: In a production environment your should remove the external port + + rabbitmq: + ports: + - "15672:15672" # Important: In a production environment your should remove the external port + - "5672:5672" # Important: In a production environment your should remove the external port + + identity.api: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=http://0.0.0.0:80 + - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104 + - XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback #localhost do not work for UWP login, so we have to use "external" IP always + - ConnectionString=${ESHOP_AZURE_IDENTITY_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word} + - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5110. + - LocationApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5109 + - MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110 + - BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103 + - OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102 + - MobileShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5120 + - WebShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121 + - UseCustomizationData=True + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} + ports: + - "5105:80" + basket.api: environment: - ASPNETCORE_ENVIRONMENT=Development @@ -47,26 +86,6 @@ services: - "5101:80" # Important: In a production environment your should remove the external port (5101) kept here for microservice debugging purposes. # The API Gateway redirects and access through the internal port (80). - identity.api: - environment: - - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_URLS=http://0.0.0.0:80 - - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104 - - XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback #localhost do not work for UWP login, so we have to use "external" IP always - - ConnectionString=${ESHOP_AZURE_IDENTITY_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word} - - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5110. - - LocationApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5109 - - MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110 - - BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103 - - OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102 - - MobileShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5120 - - WebShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121 - - UseCustomizationData=True - - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - - OrchestratorType=${ORCHESTRATOR_TYPE} - ports: - - "5105:80" - ordering.api: environment: - ASPNETCORE_ENVIRONMENT=Development @@ -131,66 +150,6 @@ services: - "5110:80" # Important: In a production environment your should remove the external port (5110) kept here for microservice debugging purposes. # The API Gateway redirects and access through the internal port (80). - webspa: - environment: - - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_URLS=http://0.0.0.0:80 - - 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. - - PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202 - - MarketingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5203 - - CatalogUrlHC=http://catalog.api/hc - - OrderingUrlHC=http://ordering.api/hc - - IdentityUrlHC=http://identity.api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. - - BasketUrlHC=http://basket.api/hc - - MarketingUrlHC=http://marketing.api/hc - - PaymentUrlHC=http://payment.api/hc - - UseCustomizationData=True - - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - - OrchestratorType=${ORCHESTRATOR_TYPE} - - SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202 - ports: - - "5104:80" - - webmvc: - environment: - - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_URLS=http://0.0.0.0:80 - - PurchaseUrl=http://webshoppingapigw - - IdentityUrl=http://10.0.75.1:5105 # Local Mac: Use http://docker.for.mac.localhost:5105 || Local Windows: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. || #Remote access: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser. - - MarketingUrl=http://webmarketingapigw - - CatalogUrlHC=http://catalog.api/hc - - OrderingUrlHC=http://ordering.api/hc - - IdentityUrlHC=http://identity.api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. - - BasketUrlHC=http://basket.api/hc - - MarketingUrlHC=http://marketing.api/hc - - PaymentUrlHC=http://payment.api/hc - - SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202 - - UseCustomizationData=True - - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - - OrchestratorType=${ORCHESTRATOR_TYPE} - - UseLoadTest=${USE_LOADTEST:-False} - ports: - - "5100:80" - - webstatus: - environment: - - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_URLS=http://0.0.0.0:80 - - CatalogUrl=http://catalog.api/hc - - OrderingUrl=http://ordering.api/hc - - OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc - - BasketUrl=http://basket.api/hc - - IdentityUrl=http://identity.api/hc - - LocationsUrl=http://locations.api/hc - - MarketingUrl=http://marketing.api/hc - - PaymentUrl=http://payment.api/hc - - mvc=http://webmvc/hc - - spa=http://webspa/hc - - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - - OrchestratorType=${ORCHESTRATOR_TYPE} - ports: - - "5107:80" - payment.api: environment: - ASPNETCORE_ENVIRONMENT=Development @@ -223,27 +182,6 @@ services: ports: - "5109:80" # Important: In a production environment your should remove the external port (5109) kept here for microservice debugging purposes. # The API Gateway redirects and access through the internal port (80). - - - sql.data: - environment: - - SA_PASSWORD=Pass@word - - ACCEPT_EULA=Y - ports: - - "5433:1433" # Important: In a production environment your should remove the external port - - nosql.data: - ports: - - "27017:27017" # Important: In a production environment your should remove the external port - - basket.data: - ports: - - "6379:6379" # Important: In a production environment your should remove the external port - - rabbitmq: - ports: - - "15672:15672" # Important: In a production environment your should remove the external port - - "5672:5672" # Important: In a production environment your should remove the external port mobileshoppingapigw: environment: @@ -253,6 +191,7 @@ services: - "5200:80" volumes: - ./src/ApiGateways/Mobile.Bff.Shopping/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration} + mobilemarketingapigw: environment: - ASPNETCORE_ENVIRONMENT=Development @@ -301,6 +240,7 @@ services: ports: - "5121:80" # Important: In a production environment your should remove the external port (5121) kept here for microservice debugging purposes. # The API Gateway redirects and access through the internal port (80). + ordering.signalrhub: environment: - ASPNETCORE_ENVIRONMENT=Development @@ -315,3 +255,63 @@ services: ports: - "5112:80" + webstatus: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=http://0.0.0.0:80 + - CatalogUrl=http://catalog.api/hc + - OrderingUrl=http://ordering.api/hc + - OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc + - BasketUrl=http://basket.api/hc + - IdentityUrl=http://identity.api/hc + - LocationsUrl=http://locations.api/hc + - MarketingUrl=http://marketing.api/hc + - PaymentUrl=http://payment.api/hc + - mvc=http://webmvc/hc + - spa=http://webspa/hc + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} + ports: + - "5107:80" + + webspa: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=http://0.0.0.0:80 + - 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. + - PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202 + - MarketingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5203 + - CatalogUrlHC=http://catalog.api/hc + - OrderingUrlHC=http://ordering.api/hc + - IdentityUrlHC=http://identity.api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. + - BasketUrlHC=http://basket.api/hc + - MarketingUrlHC=http://marketing.api/hc + - PaymentUrlHC=http://payment.api/hc + - UseCustomizationData=True + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} + - SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202 + ports: + - "5104:80" + + webmvc: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=http://0.0.0.0:80 + - PurchaseUrl=http://webshoppingapigw + - IdentityUrl=http://10.0.75.1:5105 # Local Mac: Use http://docker.for.mac.localhost:5105 || Local Windows: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. || #Remote access: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser. + - MarketingUrl=http://webmarketingapigw + - CatalogUrlHC=http://catalog.api/hc + - OrderingUrlHC=http://ordering.api/hc + - IdentityUrlHC=http://identity.api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. + - BasketUrlHC=http://basket.api/hc + - MarketingUrlHC=http://marketing.api/hc + - PaymentUrlHC=http://payment.api/hc + - SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202 + - UseCustomizationData=True + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} + - UseLoadTest=${USE_LOADTEST:-False} + ports: + - "5100:80" + diff --git a/docker-compose.windows.yml b/docker-compose.windows.yml index 4b2eb1a9b..afc7e4e91 100644 --- a/docker-compose.windows.yml +++ b/docker-compose.windows.yml @@ -5,33 +5,33 @@ version: '3.4' services: + sql.data: + image: microsoft/mssql-server-windows-developer + + nosql.data: + image: mongo:windowsservercore + + basket.data: + image: redis:nanoserver + + rabbitmq: + image: spring2/rabbitmq + identity.api: build: args: NODE_IMAGE: stefanscherer/node-windows:8.11 - webmvc: + webspa: build: args: NODE_IMAGE: stefanscherer/node-windows:8.11 - - webspa: + + webmvc: build: args: NODE_IMAGE: stefanscherer/node-windows:8.11 - sql.data: - image: microsoft/mssql-server-windows-developer - - nosql.data: - image: mongo:windowsservercore - - basket.data: - image: redis:nanoserver - - rabbitmq: - image: spring2/rabbitmq - networks: default: diff --git a/docker-compose.yml b/docker-compose.yml index 097643a3c..95610ebd5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: basket.data: image: redis:alpine - + rabbitmq: image: rabbitmq:3-management-alpine @@ -76,7 +76,7 @@ services: dockerfile: src/Services/Payment/Payment.API/Dockerfile depends_on: - rabbitmq - + locations.api: image: eshop/locations.api:${TAG:-latest} build: @@ -100,7 +100,7 @@ services: - marketing.api - catalog.api - basket.api - + mobilemarketingapigw: image: eshop/ocelotapigw:${TAG:-latest} build: @@ -115,7 +115,7 @@ services: - marketing.api - catalog.api - basket.api - + webshoppingapigw: image: eshop/ocelotapigw:${TAG:-latest} build: @@ -207,7 +207,6 @@ services: # - webshoppingapigw # - webmarketingapigw - webmvc: image: eshop/webmvc:${TAG:-latest} build: From 07ba966956e2fbb40c83881cd1d497bead2dc7c3 Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Mon, 2 Jul 2018 13:41:00 +0100 Subject: [PATCH 2/3] Fix scripts to handle eiximenis node workaround --- cli-windows/build-images.ps1 | 2 +- cli-windows/start-windows-containers.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cli-windows/build-images.ps1 b/cli-windows/build-images.ps1 index d454f3a14..bfd6e478b 100644 --- a/cli-windows/build-images.ps1 +++ b/cli-windows/build-images.ps1 @@ -8,4 +8,4 @@ if ([string]::IsNullOrEmpty($imageTag)) { Write-Host "Building images with tag $imageTag" -ForegroundColor Yellow $env:TAG=$imageTag -docker-compose -f "$scriptPath\..\docker-compose.yml" build \ No newline at end of file +docker-compose -f "$scriptPath\..\docker-compose.yml" -f "$scriptPath\..\docker-compose.windows.yml" build \ No newline at end of file diff --git a/cli-windows/start-windows-containers.ps1 b/cli-windows/start-windows-containers.ps1 index e89a89066..31e265322 100644 --- a/cli-windows/start-windows-containers.ps1 +++ b/cli-windows/start-windows-containers.ps1 @@ -23,6 +23,7 @@ if ($buildBits) { $env:ESHOP_EXTERNAL_DNS_NAME_OR_IP = "10.0.75.1" $env:ESHOP_AZURE_STORAGE_CATALOG_URL ="http://10.0.75.1:5101/api/v1/catalog/items/[0]/pic/" $env:ESHOP_AZURE_STORAGE_MARKETING_URL ="http://10.0.75.1:5110/api/v1/campaigns/[0]/pic/" +$env:ESHOP_OCELOT_VOLUME_SPEC ="C:\app\configuration" if (-Not $customEventBusLoginPassword) { docker-compose -f "$rootPath\docker-compose.yml" -f "$rootPath\docker-compose.override.yml" -f "$rootPath\docker-compose.windows.yml" -f "$rootPath\docker-compose.override.windows.yml" up From 0a57e8df400e75e5bc999a2a80bc2699959c6e8f Mon Sep 17 00:00:00 2001 From: Miguel Veloso Date: Mon, 2 Jul 2018 13:42:18 +0100 Subject: [PATCH 3/3] Add build stopwatch --- run-docker-compose-build.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 run-docker-compose-build.ps1 diff --git a/run-docker-compose-build.ps1 b/run-docker-compose-build.ps1 new file mode 100644 index 000000000..7d99ee0e7 --- /dev/null +++ b/run-docker-compose-build.ps1 @@ -0,0 +1,14 @@ +$startTime = $(Get-Date) + +docker-compose build + +$elapsedTime = $(Get-Date) - $startTime + +$elapsedTime + +# "Beep" from: http://jeffwouters.nl/index.php/2012/03/get-your-geek-on-with-powershell-and-some-music/ +[console]::beep(900,400) +[console]::beep(1000,400) +[console]::beep(800,400) +[console]::beep(400,400) +[console]::beep(600,1600)