Skip to content

Commit

Permalink
Merge pull request MicrosoftDocs#10 from PhilStollery/container-updates
Browse files Browse the repository at this point in the history
Container updates
  • Loading branch information
jamesmontemagno authored Mar 8, 2024
2 parents 19e4983 + d8298e8 commit 46fb04f
Show file tree
Hide file tree
Showing 36 changed files with 34 additions and 277 deletions.
13 changes: 3 additions & 10 deletions dotnet-compliance/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ version: '3.4'
services:

frontend:
image: storeimage
build:
context: .
dockerfile: ./eShopLite/Store/Dockerfile
image: store:latest
environment:
- ProductEndpoint=http://backend:8080
- ImagePrefix=http://localhost:32001
ports:
- "32000:8080"
depends_on:
- backend
backend:
image: productservice
build:
context: .
dockerfile: ./eShopLite/Products/Dockerfile
image: products:latest
ports:
- "32001:8080"
- "32001:8080"
20 changes: 0 additions & 20 deletions dotnet-compliance/eShopLite/Products/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion dotnet-compliance/eShopLite/Products/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ProductsContext": "Data Source=Database.db"
"ProductsContext": "Data Source=/home/app/Database.db"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ else
@foreach (var product in products)
{
<tr>
<td><img height="80" width="80" src="@imagePrefix/@product.ImageUrl" /></td>
<td><img height="80" width="80" src="https://raw.githubusercontent.com/MicrosoftDocs/mslearn-dotnet-cloudnative/main/dotnet-docker/Products/wwwroot/images/@product.ImageUrl" /></td>
<td>@product.Name</td>
<td>@product.Description</td>
<td>@product.Price</td>
Expand All @@ -63,7 +63,6 @@ else
private bool visible = false;
private int selectedProductID;
private List<Product>? products;
private string imagePrefix = string.Empty;

private Order order = new Order { Products = new List<Product>() };

Expand Down Expand Up @@ -96,7 +95,6 @@ else

protected override async Task OnInitializedAsync()
{
imagePrefix = Configuration["ImagePrefix"]!;
products = await ProductService.GetProducts();
}

Expand Down
20 changes: 0 additions & 20 deletions dotnet-compliance/eShopLite/Store/Dockerfile

This file was deleted.

3 changes: 1 addition & 2 deletions dotnet-compliance/eShopLite/Store/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
},
"AllowedHosts": "*",
"ProductEndpoint": "http://localhost:32001",
"ProductEndpointHttps": "https://localhost:32001",
"ImagePrefix": "http://localhost:32001/images"
"ProductEndpointHttps": "https://localhost:32001"
}
Empty file removed dotnet-docker/Products/Dockerfile
Empty file.
5 changes: 2 additions & 3 deletions dotnet-docker/Store/Components/Pages/Products.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ else
@foreach (var product in products)
{
<tr>
<td><img height="80" width="80" src="@imagePrefix/@product.ImageUrl" /></td>
<!-- Simulating images being hosted on a CDN -->
<td><img height="80" width="80" src="https://raw.githubusercontent.com/MicrosoftDocs/mslearn-dotnet-cloudnative/main/dotnet-docker/Products/wwwroot/images/@product.ImageUrl" /></td>
<td>@product.Name</td>
<td>@product.Description</td>
<td>@product.Price</td>
Expand All @@ -42,13 +43,11 @@ else

@code {
private List<Product>? products;
private string imagePrefix = string.Empty;

protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate streaming rendering
await Task.Delay(500);
imagePrefix = Configuration["ImagePrefix"]!;
products = await ProductService.GetProducts();
}

Expand Down
20 changes: 0 additions & 20 deletions dotnet-docker/Store/Dockerfile

This file was deleted.

3 changes: 1 addition & 2 deletions dotnet-docker/Store/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
},
"AllowedHosts": "*",
"ProductEndpoint": "http://orange-fishstick-5444qv4jxq5h77qp-32001.app.github.dev",
"ProductEndpointHttps": "https://orange-fishstick-5444qv4jxq5h77qp-32001.app.github.dev/",
"ImagePrefix": "http://orange-fishstick-5444qv4jxq5h77qp-32001.app.github.dev/images"
"ProductEndpointHttps": "https://orange-fishstick-5444qv4jxq5h77qp-32001.app.github.dev/"
}
11 changes: 2 additions & 9 deletions dotnet-docker/finished-files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ version: '3.4'
services:

frontend:
image: storeimage
build:
context: .
dockerfile: ./Store/Dockerfile
image: store:latest
environment:
- ProductEndpoint=http://backend:8080
- ImagePrefix=http://localhost/images
ports:
- "32000:8080"
depends_on:
- backend
backend:
image: productservice
build:
context: .
dockerfile: ./Products/Dockerfile
image: products:latest
ports:
- "32001:8080"
20 changes: 0 additions & 20 deletions dotnet-feature-flags/DockerfileProducts

This file was deleted.

20 changes: 0 additions & 20 deletions dotnet-feature-flags/DockerfileStore

This file was deleted.

2 changes: 1 addition & 1 deletion dotnet-feature-flags/Products/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ProductsContext": "Data Source=Database.db"
"ProductsContext": "Data Source=/home/app/Database.db"
}
}
4 changes: 1 addition & 3 deletions dotnet-feature-flags/Store/Components/Pages/Products.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
@foreach (var product in products)
{
<tr>
<td><img height="80" width="80" src="@imagePrefix/@product.ImageUrl" /></td>
<td><img height="80" width="80" src="https://raw.githubusercontent.com/MicrosoftDocs/mslearn-dotnet-cloudnative/main/dotnet-docker/Products/wwwroot/images/@product.ImageUrl" /></td>
<td>@product.Name</td>
<td>@product.Description</td>
<td>@product.Price </td>
Expand All @@ -49,13 +49,11 @@ else

@code {
private List<Product>? products;
private string imagePrefix = string.Empty;

protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate streaming rendering
await Task.Delay(500);
imagePrefix = Configuration["ImagePrefix"];
products = await ProductService.GetProducts();
}

Expand Down
1 change: 0 additions & 1 deletion dotnet-feature-flags/Store/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"AllowedHosts": "*",
"ProductEndpoint": "http://localhost:32001",
"ProductEndpointHttps": "https://localhost:32001",
"ImagePrefix": "http://localhost:32001/images",
"ConnectionStrings:AppConfig": "[PASTE IN YOUR CREDENTIALS HERE]"
}
13 changes: 3 additions & 10 deletions dotnet-feature-flags/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,15 @@ version: '3.4'
services:

frontend:
image: storeimage
build:
context: .
dockerfile: DockerfileStore
image: store:latest
environment:
- ProductEndpoint=http://backend:8080
- ImagePrefix=http://localhost:32001/images
- ConnectionStrings:AppConfig=[PASTE CONNECTION STRING HERE]
ports:
- "32000:8080"
depends_on:
- backend
backend:
image: productservice
build:
context: .
dockerfile: DockerfileProducts
image: products:latest
ports:
- "32001:8080"
- "32001:8080"
20 changes: 0 additions & 20 deletions dotnet-kubernetes/DockerfileProducts

This file was deleted.

20 changes: 0 additions & 20 deletions dotnet-kubernetes/DockerfileStore

This file was deleted.

2 changes: 1 addition & 1 deletion dotnet-kubernetes/Products/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ProductsContext": "Data Source=Database.db"
"ProductsContext": "Data Source=/home/app/Database.db"
}
}
4 changes: 1 addition & 3 deletions dotnet-kubernetes/Store/Components/Pages/Products.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else
@foreach (var product in products)
{
<tr>
<td><img height="80" width="80" src="@imagePrefix/@product.ImageUrl" /></td>
<td><img height="80" width="80" src="https://raw.githubusercontent.com/MicrosoftDocs/mslearn-dotnet-cloudnative/main/dotnet-docker/Products/wwwroot/images/@product.ImageUrl" /></td>
<td>@product.Name</td>
<td>@product.Description</td>
<td>@product.Price</td>
Expand All @@ -42,13 +42,11 @@ else

@code {
private List<Product>? products;
private string imagePrefix = string.Empty;

protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate streaming rendering
await Task.Delay(500);
imagePrefix = Configuration["ImagePrefix"];
products = await ProductService.GetProducts();
}

Expand Down
3 changes: 1 addition & 2 deletions dotnet-kubernetes/Store/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
},
"AllowedHosts": "*",
"ProductEndpoint": "http://localhost:32001",
"ProductEndpointHttps": "https://localhost:32001",
"ImagePrefix": "http://localhost:32001/images"
"ProductEndpointHttps": "https://localhost:32001"
}
Loading

0 comments on commit 46fb04f

Please sign in to comment.