Skip to content

Commit 3df4f3a

Browse files
committed
Configure service URLs via environment variables
1 parent a07bb18 commit 3df4f3a

7 files changed

Lines changed: 16 additions & 37 deletions

File tree

docker-compose.override.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ services:
55
basket.api:
66
environment:
77
- ASPNETCORE_ENVIRONMENT=Development
8+
- ASPNETCORE_URLS=http://0.0.0.0:5103
89
- ConnectionString=basket.data
910
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
1011
- 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:
1415
catalog.api:
1516
environment:
1617
- ASPNETCORE_ENVIRONMENT=Development
18+
- ASPNETCORE_URLS=http://0.0.0.0:5101
1719
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
1820
#- ExternalCatalogBaseUrl=http://13.88.8.119:5101 #Remote: VM Needs to have public access at 5105.
1921
- 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:
2325
identity.api:
2426
environment:
2527
- ASPNETCORE_ENVIRONMENT=Development
28+
- ASPNETCORE_URLS=http://0.0.0.0:5105
2629
- SpaClient=http://localhost:5104
2730
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word
2831
#- MvcClient=http://13.88.8.119:5100 #Remote: VM Needs to have public access at 5105.
@@ -33,6 +36,7 @@ services:
3336
ordering.api:
3437
environment:
3538
- ASPNETCORE_ENVIRONMENT=Development
39+
- ASPNETCORE_URLS=http://0.0.0.0:5102
3640
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
3741
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
3842
- 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:
4246
webspa:
4347
environment:
4448
- ASPNETCORE_ENVIRONMENT=Development
49+
- ASPNETCORE_URLS=http://0.0.0.0:5104
4550
- CatalogUrl=http://localhost:5101
4651
- OrderingUrl=http://localhost:5102
4752
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
@@ -53,6 +58,7 @@ services:
5358
webmvc:
5459
environment:
5560
- ASPNETCORE_ENVIRONMENT=Development
61+
- ASPNETCORE_URLS=http://0.0.0.0:5100
5662
- CatalogUrl=http://catalog.api:5101
5763
- OrderingUrl=http://ordering.api:5102
5864
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.

src/Services/Basket/Basket.API/Program.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
1+
using Microsoft.AspNetCore.Builder;
62
using Microsoft.AspNetCore.Hosting;
7-
using Microsoft.AspNetCore.Builder;
3+
using System.IO;
84

95
namespace Microsoft.eShopOnContainers.Services.Basket.API
106
{
@@ -15,7 +11,6 @@ public static void Main(string[] args)
1511
var host = new WebHostBuilder()
1612
.UseKestrel()
1713
.UseContentRoot(Directory.GetCurrentDirectory())
18-
.UseUrls("http://0.0.0.0:5103")
1914
.UseIISIntegration()
2015
.UseStartup<Startup>()
2116
.Build();

src/Services/Catalog/Catalog.API/Program.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
1+
using Microsoft.AspNetCore.Builder;
62
using Microsoft.AspNetCore.Hosting;
7-
using Microsoft.AspNetCore.Builder;
3+
using System.IO;
84

95
namespace Microsoft.eShopOnContainers.Services.Catalog.API
106
{
@@ -14,7 +10,6 @@ public static void Main(string[] args)
1410
{
1511
var host = new WebHostBuilder()
1612
.UseKestrel()
17-
.UseUrls("http://0.0.0.0:5101")
1813
.UseIISIntegration()
1914
.UseContentRoot(Directory.GetCurrentDirectory())
2015
.UseWebRoot("Pics")

src/Services/Identity/Identity.API/Program.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using Microsoft.AspNetCore.Hosting;
32
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
6-
using Microsoft.AspNetCore.Hosting;
73

84
namespace eShopOnContainers.Identity
95
{
@@ -13,7 +9,6 @@ public static void Main(string[] args)
139
{
1410
var host = new WebHostBuilder()
1511
.UseKestrel()
16-
.UseUrls("http://0.0.0.0:5105")
1712
.UseContentRoot(Directory.GetCurrentDirectory())
1813
.UseIISIntegration()
1914
.UseStartup<Startup>()

src/Services/Ordering/Ordering.API/Program.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
1+
using Microsoft.AspNetCore.Builder;
62
using Microsoft.AspNetCore.Hosting;
7-
using Microsoft.AspNetCore.Builder;
3+
using System.IO;
84

95
namespace Microsoft.eShopOnContainers.Services.Ordering.API
106
{
@@ -15,7 +11,6 @@ public static void Main(string[] args)
1511
var host = new WebHostBuilder()
1612
.UseKestrel()
1713
.UseContentRoot(Directory.GetCurrentDirectory())
18-
.UseUrls("http://0.0.0.0:5102")
1914
.UseIISIntegration()
2015
.UseStartup<Startup>()
2116
.Build();

src/Web/WebMVC/Program.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using Microsoft.AspNetCore.Hosting;
32
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
6-
using Microsoft.AspNetCore.Hosting;
73

84
namespace Microsoft.eShopOnContainers.WebMVC
95
{
@@ -14,7 +10,6 @@ public static void Main(string[] args)
1410
var host = new WebHostBuilder()
1511
.UseKestrel()
1612
.UseContentRoot(Directory.GetCurrentDirectory())
17-
.UseUrls("http://0.0.0.0:5100")
1813
.UseIISIntegration()
1914
.UseStartup<Startup>()
2015
.Build();

src/Web/WebSPA/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using System.IO;
2-
using Microsoft.AspNetCore.Hosting;
3-
using Microsoft.Extensions.Configuration;
1+
using Microsoft.AspNetCore.Hosting;
2+
using System.IO;
43

54
namespace eShopConContainers.WebSPA
65
{
@@ -11,7 +10,6 @@ public static void Main(string[] args)
1110
var host = new WebHostBuilder()
1211
.UseKestrel()
1312
.UseContentRoot(Directory.GetCurrentDirectory())
14-
.UseUrls("http://0.0.0.0:5104")
1513
.UseIISIntegration()
1614
.UseStartup<Startup>()
1715
.Build();

0 commit comments

Comments
 (0)