diff --git a/.env b/.env new file mode 100644 index 000000000..2ce566356 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +# Compose supports declaring default environment variables in an environment file named .env placed in the folder docker-compose command is executed from (current working directory). +# Compose expects each line in an env file to be in VAR=VAL format. Lines beginning with # (i.e. comments) are ignored, as are blank lines. +# 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. + +ESHOP_EXTERNAL_DNS_NAME_OR_IP=192.168.88.248 \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 7132c52d6..de5dba15e 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,6 +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 +# but values present in the environment vars at runtime will always override those defined inside the .env file # This configuration has to be used when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance. # ASPNETCORE_ENVIRONMENT=Development just to get errors while testing. Could be set to "Production" # @@ -23,7 +25,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_IP}:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - 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. ports: - "5101:5101" @@ -31,9 +33,9 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5105 - - SpaClient=http://${ESHOP_EXTERNAL_IP}:5104 + - SpaClient=http://${ESHOP_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_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. + - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. ports: - "5105:5105" @@ -50,10 +52,10 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5104 - - CatalogUrl=http://${ESHOP_EXTERNAL_IP}:5101 - - OrderingUrl=http://${ESHOP_EXTERNAL_IP}:5102 - - IdentityUrl=http://${ESHOP_EXTERNAL_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. - - BasketUrl=http://${ESHOP_EXTERNAL_IP}:5103 + - 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 ports: - "5104:5104" @@ -63,7 +65,7 @@ services: - ASPNETCORE_URLS=http://0.0.0.0:5100 - CatalogUrl=http://catalog.api:5101 - OrderingUrl=http://ordering.api:5102 - - IdentityUrl=http://${ESHOP_EXTERNAL_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - 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://basket.api:5103 ports: - "5100:5100"