Browse Source

Configure service URLs via environment variables

pull/68/head
Charles Lowell 8 years ago
parent
commit
3df4f3a206
7 changed files with 16 additions and 37 deletions
  1. +6
    -0
      docker-compose.override.yml
  2. +2
    -7
      src/Services/Basket/Basket.API/Program.cs
  3. +2
    -7
      src/Services/Catalog/Catalog.API/Program.cs
  4. +1
    -6
      src/Services/Identity/Identity.API/Program.cs
  5. +2
    -7
      src/Services/Ordering/Ordering.API/Program.cs
  6. +1
    -6
      src/Web/WebMVC/Program.cs
  7. +2
    -4
      src/Web/WebSPA/Program.cs

+ 6
- 0
docker-compose.override.yml View File

@ -5,6 +5,7 @@ services:
basket.api: basket.api:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:5103
- ConnectionString=basket.data - ConnectionString=basket.data
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. #- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. - identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
@ -14,6 +15,7 @@ services:
catalog.api: catalog.api:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - 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 - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
#- ExternalCatalogBaseUrl=http://13.88.8.119:5101 #Remote: VM Needs to have public access at 5105. #- ExternalCatalogBaseUrl=http://13.88.8.119:5101 #Remote: VM Needs to have public access at 5105.
- ExternalCatalogBaseUrl=http://localhost:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. - ExternalCatalogBaseUrl=http://localhost:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
@ -23,6 +25,7 @@ services:
identity.api: identity.api:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:5105
- SpaClient=http://localhost:5104 - SpaClient=http://localhost:5104
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word
#- MvcClient=http://13.88.8.119:5100 #Remote: VM Needs to have public access at 5105. #- MvcClient=http://13.88.8.119:5100 #Remote: VM Needs to have public access at 5105.
@ -33,6 +36,7 @@ services:
ordering.api: ordering.api:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:5102
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. #- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. - identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
@ -42,6 +46,7 @@ services:
webspa: webspa:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:5104
- CatalogUrl=http://localhost:5101 - CatalogUrl=http://localhost:5101
- OrderingUrl=http://localhost:5102 - OrderingUrl=http://localhost:5102
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. #- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
@ -53,6 +58,7 @@ services:
webmvc: webmvc:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:5100
- CatalogUrl=http://catalog.api:5101 - CatalogUrl=http://catalog.api:5101
- OrderingUrl=http://ordering.api:5102 - OrderingUrl=http://ordering.api:5102
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. #- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.


+ 2
- 7
src/Services/Basket/Basket.API/Program.cs View File

@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using System.IO;
namespace Microsoft.eShopOnContainers.Services.Basket.API namespace Microsoft.eShopOnContainers.Services.Basket.API
{ {
@ -15,7 +11,6 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseUrls("http://0.0.0.0:5103")
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();


+ 2
- 7
src/Services/Catalog/Catalog.API/Program.cs View File

@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using System.IO;
namespace Microsoft.eShopOnContainers.Services.Catalog.API namespace Microsoft.eShopOnContainers.Services.Catalog.API
{ {
@ -14,7 +10,6 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseUrls("http://0.0.0.0:5101")
.UseIISIntegration() .UseIISIntegration()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseWebRoot("Pics") .UseWebRoot("Pics")


+ 1
- 6
src/Services/Identity/Identity.API/Program.cs View File

@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Hosting;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
namespace eShopOnContainers.Identity namespace eShopOnContainers.Identity
{ {
@ -13,7 +9,6 @@ namespace eShopOnContainers.Identity
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseUrls("http://0.0.0.0:5105")
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()


+ 2
- 7
src/Services/Ordering/Ordering.API/Program.cs View File

@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using System.IO;
namespace Microsoft.eShopOnContainers.Services.Ordering.API namespace Microsoft.eShopOnContainers.Services.Ordering.API
{ {
@ -15,7 +11,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseUrls("http://0.0.0.0:5102")
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();


+ 1
- 6
src/Web/WebMVC/Program.cs View File

@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Hosting;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
namespace Microsoft.eShopOnContainers.WebMVC namespace Microsoft.eShopOnContainers.WebMVC
{ {
@ -14,7 +10,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseUrls("http://0.0.0.0:5100")
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();


+ 2
- 4
src/Web/WebSPA/Program.cs View File

@ -1,6 +1,5 @@
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Hosting;
using System.IO;
namespace eShopConContainers.WebSPA namespace eShopConContainers.WebSPA
{ {
@ -11,7 +10,6 @@ namespace eShopConContainers.WebSPA
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseUrls("http://0.0.0.0:5104")
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();


Loading…
Cancel
Save