From d7ab4d89d4665730220db94600724226abe2a549 Mon Sep 17 00:00:00 2001 From: Cesar De la Torre Date: Sat, 11 Mar 2017 15:28:57 -0800 Subject: [PATCH] Added ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP to .env and docker-compose.prod.yml for production config so it does not impact to the localhost config. --- .env | 3 ++- docker-compose.override.yml | 3 ++- docker-compose.prod.yml | 19 ++++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.env b/.env index fe49799c7..0647574cc 100644 --- a/.env +++ b/.env @@ -3,4 +3,5 @@ # Note: Values present in the environment at runtime will always override those defined inside the .env file. Similarly, values passed via command-line arguments take precedence as well. # localhost should be swapped to your real IP or DNS name, like 192.168.88.248, etc. if testing from remote browsers or mobile devices -ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost \ No newline at end of file +ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost +ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=192.168.88.248 \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index cc7615dc0..f51115a0f 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,7 +1,8 @@ version: '2' # The default docker-compose.override file can use the "localhost" as the external name for testing web apps within the same dev machine. -# The ESHOP_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost +# The ESHOP_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like: +# ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost # but values present in the environment vars at runtime will always override those defined inside the .env file # 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. diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index b9ad8c85f..9d3d29f09 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,7 +1,8 @@ version: '2' # The Production docker-compose file has to have the external/real IPs or DNS names for the services -# The ESHOP_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like ESHOP_EXTERNAL_DNS_NAME_OR_IP=192.168.88.248 +# The ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like: +# ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=192.168.88.248 # but values present in the environment vars at runtime will always override those defined inside the .env file # 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. # @@ -26,7 +27,7 @@ services: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5101 - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word - - ExternalCatalogBaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - 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. ports: - "5101:5101" @@ -34,9 +35,9 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5105 - - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104 + - SpaClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5104 - ConnectionStrings__DefaultConnection=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 host's firewall at range 5100-5105. + - MvcClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. ports: - "5105:5105" @@ -53,10 +54,10 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5104 - - CatalogUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5101 - - OrderingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102 - - IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. - - BasketUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103 + - CatalogUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101 + - OrderingUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5102 + - 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. + - BasketUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5103 ports: - "5104:5104" @@ -66,7 +67,7 @@ services: - ASPNETCORE_URLS=http://0.0.0.0:5100 - CatalogUrl=http://catalog.api:5101 - OrderingUrl=http://ordering.api:5102 - - IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. + - 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. - BasketUrl=http://basket.api:5103 ports: - "5100:5100"