Compare commits
7 Commits
davidfowl/
...
dev
Author | SHA1 | Date | |
---|---|---|---|
|
47643eb2d0 | ||
|
7a5e502428 | ||
|
47d4d3cff6 | ||
|
becce91a7c | ||
|
06d5164532 | ||
|
67d4c06b6d | ||
|
508fa593d7 |
BIN
gothrough docs.docx
Normal file
BIN
gothrough docs.docx
Normal file
Binary file not shown.
6
src/.env
6
src/.env
@ -6,15 +6,15 @@
|
||||
|
||||
# Use this values to run the app locally in Windows
|
||||
ESHOP_EXTERNAL_DNS_NAME_OR_IP=host.docker.internal
|
||||
ESHOP_STORAGE_CATALOG_URL=http://host.docker.internal:5202/c/api/v1/catalog/items/[0]/pic/
|
||||
ESHOP_STORAGE_CATALOG_URL=http://host.docker.internal:5121/c/api/v1/catalog/items/[0]/pic/
|
||||
|
||||
# Use this values to run the app locally in Mac
|
||||
# ESHOP_EXTERNAL_DNS_NAME_OR_IP=docker.for.mac.localhost
|
||||
# ESHOP_STORAGE_CATALOG_URL=http://docker.for.mac.localhost:5202/c/api/v1/catalog/items/[0]/pic/
|
||||
# ESHOP_STORAGE_CATALOG_URL=http://docker.for.mac.localhost:5121/c/api/v1/catalog/items/[0]/pic/
|
||||
|
||||
# Use this values to run the app locally in Linux
|
||||
# ESHOP_EXTERNAL_DNS_NAME_OR_IP=docker.for.linux.localhost
|
||||
# ESHOP_STORAGE_CATALOG_URL=http://docker.for.linux.localhost:5202/c/api/v1/catalog/items/[0]/pic/
|
||||
# ESHOP_STORAGE_CATALOG_URL=http://docker.for.linux.localhost:5121/c/api/v1/catalog/items/[0]/pic/
|
||||
|
||||
# Configure this values to the cloud storage locations
|
||||
# ESHOP_STORAGE_CATALOG_URL=<YourAzureStorage_Catalog_BLOB_URL>
|
||||
|
@ -1,139 +0,0 @@
|
||||
admin:
|
||||
access_log_path: "/dev/null"
|
||||
address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 8001
|
||||
static_resources:
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 80
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.http_connection_manager
|
||||
config:
|
||||
codec_type: auto
|
||||
stat_prefix: ingress_http
|
||||
route_config:
|
||||
name: eshop_backend_route
|
||||
virtual_hosts:
|
||||
- name: eshop_backend
|
||||
domains:
|
||||
- "*"
|
||||
routes:
|
||||
- name: "c-short"
|
||||
match:
|
||||
prefix: "/c/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/catalog-api/"
|
||||
cluster: catalog
|
||||
- name: "c-long"
|
||||
match:
|
||||
prefix: "/catalog-api/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: catalog
|
||||
- name: "o-short"
|
||||
match:
|
||||
prefix: "/o/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/ordering-api/"
|
||||
cluster: ordering
|
||||
- name: "o-long"
|
||||
match:
|
||||
prefix: "/ordering-api/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: ordering
|
||||
- name: "h-long"
|
||||
match:
|
||||
prefix: "/hub/notificationhub"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: signalr-hub
|
||||
timeout: 300s
|
||||
- name: "b-short"
|
||||
match:
|
||||
prefix: "/b/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/basket-api/"
|
||||
cluster: basket
|
||||
- name: "b-long"
|
||||
match:
|
||||
prefix: "/basket-api/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: basket
|
||||
- name: "agg"
|
||||
match:
|
||||
prefix: "/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/"
|
||||
cluster: shoppingagg
|
||||
http_filters:
|
||||
- name: envoy.router
|
||||
access_log:
|
||||
- name: envoy.file_access_log
|
||||
filter:
|
||||
not_health_check_filter: {}
|
||||
config:
|
||||
json_format:
|
||||
time: "%START_TIME%"
|
||||
protocol: "%PROTOCOL%"
|
||||
duration: "%DURATION%"
|
||||
request_method: "%REQ(:METHOD)%"
|
||||
request_host: "%REQ(HOST)%"
|
||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
|
||||
response_flags: "%RESPONSE_FLAGS%"
|
||||
route_name: "%ROUTE_NAME%"
|
||||
upstream_host: "%UPSTREAM_HOST%"
|
||||
upstream_cluster: "%UPSTREAM_CLUSTER%"
|
||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%"
|
||||
path: "/tmp/access.log"
|
||||
clusters:
|
||||
- name: shoppingagg
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: mobileshoppingagg
|
||||
port_value: 80
|
||||
- name: catalog
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: catalog-api
|
||||
port_value: 80
|
||||
- name: basket
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: basket-api
|
||||
port_value: 80
|
||||
- name: ordering
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: ordering-api
|
||||
port_value: 80
|
||||
- name: signalr-hub
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: ordering-signalrhub
|
||||
port_value: 80
|
@ -1,142 +0,0 @@
|
||||
admin:
|
||||
access_log_path: "/dev/null"
|
||||
address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 8001
|
||||
static_resources:
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 80
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.http_connection_manager
|
||||
config:
|
||||
codec_type: auto
|
||||
stat_prefix: ingress_http
|
||||
route_config:
|
||||
name: eshop_backend_route
|
||||
virtual_hosts:
|
||||
- name: eshop_backend
|
||||
domains:
|
||||
- "*"
|
||||
routes:
|
||||
- name: "c-short"
|
||||
match:
|
||||
prefix: "/c/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/catalog-api/"
|
||||
cluster: catalog
|
||||
- name: "c-long"
|
||||
match:
|
||||
prefix: "/catalog-api/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: catalog
|
||||
- name: "o-short"
|
||||
match:
|
||||
prefix: "/o/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/ordering-api/"
|
||||
cluster: ordering
|
||||
- name: "o-long"
|
||||
match:
|
||||
prefix: "/ordering-api/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: ordering
|
||||
- name: "h-long"
|
||||
match:
|
||||
prefix: "/hub/notificationhub"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: signalr-hub
|
||||
timeout: 300s
|
||||
upgrade_configs:
|
||||
upgrade_type: "websocket"
|
||||
enabled: true
|
||||
- name: "b-short"
|
||||
match:
|
||||
prefix: "/b/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/basket-api/"
|
||||
cluster: basket
|
||||
- name: "b-long"
|
||||
match:
|
||||
prefix: "/basket-api/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
cluster: basket
|
||||
- name: "agg"
|
||||
match:
|
||||
prefix: "/"
|
||||
route:
|
||||
auto_host_rewrite: true
|
||||
prefix_rewrite: "/"
|
||||
cluster: shoppingagg
|
||||
http_filters:
|
||||
- name: envoy.router
|
||||
access_log:
|
||||
- name: envoy.file_access_log
|
||||
filter:
|
||||
not_health_check_filter: {}
|
||||
config:
|
||||
json_format:
|
||||
time: "%START_TIME%"
|
||||
protocol: "%PROTOCOL%"
|
||||
duration: "%DURATION%"
|
||||
request_method: "%REQ(:METHOD)%"
|
||||
request_host: "%REQ(HOST)%"
|
||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
|
||||
response_flags: "%RESPONSE_FLAGS%"
|
||||
route_name: "%ROUTE_NAME%"
|
||||
upstream_host: "%UPSTREAM_HOST%"
|
||||
upstream_cluster: "%UPSTREAM_CLUSTER%"
|
||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%"
|
||||
path: "/tmp/access.log"
|
||||
clusters:
|
||||
- name: shoppingagg
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: webshoppingagg
|
||||
port_value: 80
|
||||
- name: catalog
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: catalog-api
|
||||
port_value: 80
|
||||
- name: basket
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: basket-api
|
||||
port_value: 80
|
||||
- name: ordering
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: ordering-api
|
||||
port_value: 80
|
||||
- name: signalr-hub
|
||||
connect_timeout: 0.25s
|
||||
type: strict_dns
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: ordering-signalrhub
|
||||
port_value: 80
|
@ -33,6 +33,7 @@ COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Service
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
||||
|
@ -1,24 +1,13 @@
|
||||
global using CatalogApi;
|
||||
global using Grpc.Core.Interceptors;
|
||||
global using System.Text.Json;
|
||||
global using CatalogApi;
|
||||
global using Grpc.Core;
|
||||
global using Grpc.Core.Interceptors;
|
||||
global using GrpcBasket;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config;
|
||||
global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Infrastructure;
|
||||
global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models;
|
||||
global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.Extensions.Options;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Net.Http;
|
||||
global using System.Net;
|
||||
global using System.Text.Json;
|
||||
global using System.Threading.Tasks;
|
||||
global using System;
|
||||
global using Services.Common;
|
||||
|
@ -5,31 +5,15 @@
|
||||
<AssemblyName>Mobile.Shopping.HttpAggregator</AssemblyName>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator</RootNamespace>
|
||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
||||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="wwwroot\**" />
|
||||
<Content Remove="wwwroot\**" />
|
||||
<EmbeddedResource Remove="wwwroot\**" />
|
||||
<None Remove="wwwroot\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Yarp.ReverseProxy" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Uris" />
|
||||
<PackageReference Include="Google.Protobuf" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Server.ClientFactory" />
|
||||
<PackageReference Include="Grpc.Core" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" />
|
||||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -33,6 +33,7 @@ COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Service
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
||||
|
@ -1,27 +1,13 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Net;
|
||||
global using System.Net.Http;
|
||||
global using System.Net.Http.Headers;
|
||||
global using System.Text.Json;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Text.Json;
|
||||
global using CatalogApi;
|
||||
global using Grpc.Core;
|
||||
global using Grpc.Core.Interceptors;
|
||||
global using GrpcBasket;
|
||||
global using Microsoft.AspNetCore.Authentication;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
|
||||
global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure;
|
||||
global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
|
||||
global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.Extensions.Options;
|
||||
global using Services.Common;
|
||||
|
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<AssemblyName>Web.Shopping.HttpAggregator</AssemblyName>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,8 +1,4 @@
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using System.Text.Json.Serialization;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using static Microsoft.eShopOnContainers.BuildingBlocks.EventBus.InMemoryEventBusSubscriptionsManager;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Text.Json.Serialization;
|
||||
global using System.Threading.Tasks;
|
||||
global using System;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,16 +1,13 @@
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using System.Net.Sockets;
|
||||
global using System.Text;
|
||||
global using System.Text.Json;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Polly;
|
||||
global using Polly.Retry;
|
||||
global using RabbitMQ.Client;
|
||||
global using RabbitMQ.Client.Events;
|
||||
global using RabbitMQ.Client.Exceptions;
|
||||
global using System;
|
||||
global using System.IO;
|
||||
global using System.Net.Sockets;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions;
|
||||
global using System.Text;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Text.Json;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using System.Threading.Tasks;
|
||||
global using System;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using System.Text;
|
||||
global using System.Text;
|
||||
global using System.Text.Json;
|
||||
global using Azure.Messaging.ServiceBus;
|
||||
global using Azure.Messaging.ServiceBus.Administration;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
|
||||
|
||||
|
||||
|
@ -1,12 +1,8 @@
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using System;
|
||||
global using System.Text.Json;
|
||||
global using System.ComponentModel.DataAnnotations.Schema;
|
||||
global using System.Linq;
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.EntityFrameworkCore.Storage;
|
||||
global using System.Collections.Generic;
|
||||
global using System.ComponentModel.DataAnnotations.Schema;
|
||||
global using System.Data.Common;
|
||||
global using System.Reflection;
|
||||
global using System.Text.Json;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
global using Microsoft.EntityFrameworkCore.Storage;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -2,23 +2,15 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
|
||||
<PackageReference Include="Microsoft.NETCore.Platforms" />
|
||||
<PackageReference Include="Polly" />
|
||||
<PackageReference Include="System.Data.SqlClient" />
|
||||
</ItemGroup>
|
||||
|
@ -1,77 +1,75 @@
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Polly;
|
||||
|
||||
namespace Microsoft.AspNetCore.Hosting
|
||||
namespace Microsoft.AspNetCore.Hosting;
|
||||
|
||||
public static class IWebHostExtensions
|
||||
{
|
||||
public static class IWebHostExtensions
|
||||
public static bool IsInKubernetes(this IServiceProvider services)
|
||||
{
|
||||
public static bool IsInKubernetes(this IServiceProvider services)
|
||||
var cfg = services.GetService<IConfiguration>();
|
||||
var orchestratorType = cfg.GetValue<string>("OrchestratorType");
|
||||
return orchestratorType?.ToUpper() == "K8S";
|
||||
}
|
||||
|
||||
public static IServiceProvider MigrateDbContext<TContext>(this IServiceProvider services, Action<TContext, IServiceProvider> seeder) where TContext : DbContext
|
||||
{
|
||||
var underK8s = services.IsInKubernetes();
|
||||
|
||||
using var scope = services.CreateScope();
|
||||
var scopeServices = scope.ServiceProvider;
|
||||
var logger = scopeServices.GetRequiredService<ILogger<TContext>>();
|
||||
var context = scopeServices.GetService<TContext>();
|
||||
|
||||
try
|
||||
{
|
||||
var cfg = services.GetService<IConfiguration>();
|
||||
var orchestratorType = cfg.GetValue<string>("OrchestratorType");
|
||||
return orchestratorType?.ToUpper() == "K8S";
|
||||
}
|
||||
logger.LogInformation("Migrating database associated with context {DbContextName}", typeof(TContext).Name);
|
||||
|
||||
public static IServiceProvider MigrateDbContext<TContext>(this IServiceProvider services, Action<TContext, IServiceProvider> seeder) where TContext : DbContext
|
||||
{
|
||||
var underK8s = services.IsInKubernetes();
|
||||
|
||||
using var scope = services.CreateScope();
|
||||
var scopeServices = scope.ServiceProvider;
|
||||
var logger = scopeServices.GetRequiredService<ILogger<TContext>>();
|
||||
var context = scopeServices.GetService<TContext>();
|
||||
|
||||
try
|
||||
if (underK8s)
|
||||
{
|
||||
logger.LogInformation("Migrating database associated with context {DbContextName}", typeof(TContext).Name);
|
||||
|
||||
if (underK8s)
|
||||
{
|
||||
InvokeSeeder(seeder, context, scopeServices);
|
||||
}
|
||||
else
|
||||
{
|
||||
var retries = 10;
|
||||
var retry = Policy.Handle<SqlException>()
|
||||
.WaitAndRetry(
|
||||
retryCount: retries,
|
||||
sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
|
||||
onRetry: (exception, timeSpan, retry, ctx) =>
|
||||
{
|
||||
logger.LogWarning(exception, "[{prefix}] Error migrating database (attempt {retry} of {retries})", nameof(TContext), retry, retries);
|
||||
});
|
||||
|
||||
//if the sql server container is not created on run docker compose this
|
||||
//migration can't fail for network related exception. The retry options for DbContext only
|
||||
//apply to transient exceptions
|
||||
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
|
||||
retry.Execute(() => InvokeSeeder(seeder, context, scopeServices));
|
||||
}
|
||||
|
||||
logger.LogInformation("Migrated database associated with context {DbContextName}", typeof(TContext).Name);
|
||||
InvokeSeeder(seeder, context, scopeServices);
|
||||
}
|
||||
catch (Exception ex)
|
||||
else
|
||||
{
|
||||
logger.LogError(ex, "An error occurred while migrating the database used on context {DbContextName}", typeof(TContext).Name);
|
||||
if (underK8s)
|
||||
{
|
||||
throw; // Rethrow under k8s because we rely on k8s to re-run the pod
|
||||
}
|
||||
var retries = 10;
|
||||
var retry = Policy.Handle<SqlException>()
|
||||
.WaitAndRetry(
|
||||
retryCount: retries,
|
||||
sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
|
||||
onRetry: (exception, timeSpan, retry, ctx) =>
|
||||
{
|
||||
logger.LogWarning(exception, "[{prefix}] Error migrating database (attempt {retry} of {retries})", nameof(TContext), retry, retries);
|
||||
});
|
||||
|
||||
//if the sql server container is not created on run docker compose this
|
||||
//migration can't fail for network related exception. The retry options for DbContext only
|
||||
//apply to transient exceptions
|
||||
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
|
||||
retry.Execute(() => InvokeSeeder(seeder, context, scopeServices));
|
||||
}
|
||||
|
||||
return services;
|
||||
logger.LogInformation("Migrated database associated with context {DbContextName}", typeof(TContext).Name);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "An error occurred while migrating the database used on context {DbContextName}", typeof(TContext).Name);
|
||||
if (underK8s)
|
||||
{
|
||||
throw; // Rethrow under k8s because we rely on k8s to re-run the pod
|
||||
}
|
||||
}
|
||||
|
||||
private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services)
|
||||
where TContext : DbContext
|
||||
{
|
||||
context.Database.Migrate();
|
||||
seeder(context, services);
|
||||
}
|
||||
return services;
|
||||
}
|
||||
|
||||
private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services)
|
||||
where TContext : DbContext
|
||||
{
|
||||
context.Database.Migrate();
|
||||
seeder(context, services);
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.AzureAppServices" Version="7.0.3" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageVersion Include="Microsoft.NETCore.Platforms" Version="7.0.0" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.4" />
|
||||
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
|
||||
<PackageVersion Include="Moq" Version="4.18.4" />
|
||||
|
@ -1,6 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<UserSecretsId>2964ec8e-0d48-4541-b305-94cab537f867</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,10 +1,6 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.ComponentModel.DataAnnotations;
|
||||
global using System.Linq;
|
||||
global using System.ComponentModel.DataAnnotations;
|
||||
global using System.Security.Claims;
|
||||
global using System.Text.Json;
|
||||
global using System.Threading.Tasks;
|
||||
global using Basket.API.IntegrationEvents.EventHandling;
|
||||
global using Basket.API.IntegrationEvents.Events;
|
||||
global using Basket.API.Model;
|
||||
@ -12,8 +8,6 @@ global using Basket.API.Repositories;
|
||||
global using Grpc.Core;
|
||||
global using GrpcBasket;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
@ -21,8 +15,5 @@ global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.E
|
||||
global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events;
|
||||
global using Microsoft.eShopOnContainers.Services.Basket.API.Model;
|
||||
global using Microsoft.eShopOnContainers.Services.Basket.API.Services;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Services.Common;
|
||||
global using StackExchange.Redis;
|
||||
|
@ -5,6 +5,7 @@
|
||||
<AssemblyName>Catalog.API</AssemblyName>
|
||||
<PackageId>Catalog.API</PackageId>
|
||||
<UserSecretsId>aspnet-Catalog.API-20161122013618</UserSecretsId>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -33,6 +33,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,17 +1,10 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Data.Common;
|
||||
global using System.Data.Common;
|
||||
global using System.Data.SqlClient;
|
||||
global using System.Globalization;
|
||||
global using System.IO;
|
||||
global using System.IO.Compression;
|
||||
global using System.Linq;
|
||||
global using System.Text.RegularExpressions;
|
||||
global using System.Threading.Tasks;
|
||||
global using Catalog.API.Apis;
|
||||
global using Grpc.Core;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Design;
|
||||
@ -32,11 +25,7 @@ global using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.
|
||||
global using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events;
|
||||
global using Microsoft.eShopOnContainers.Services.Catalog.API.Model;
|
||||
global using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.Extensions.Options;
|
||||
global using Polly;
|
||||
global using Polly.Retry;
|
||||
global using Services.Common;
|
||||
global using Catalog.API.Apis;
|
||||
|
26
src/Services/Contact/Contact.API/Contact.API.csproj
Normal file
26
src/Services/Contact/Contact.API/Contact.API.csproj
Normal file
@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>9457faa3-370a-4009-8020-10e7de0fbf17</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..\..</DockerfileContext>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,48 @@
|
||||
using Contact.API.Model;
|
||||
using Contact.API.ViewModel;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Contact.API.Controllers;
|
||||
|
||||
[Route("api/v1/[controller]")]
|
||||
[ApiController]
|
||||
public class ContactController : ControllerBase
|
||||
{
|
||||
private readonly ApplicationDBContext _context;
|
||||
|
||||
public ContactController(ApplicationDBContext context)
|
||||
{
|
||||
this._context = context ?? throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("CreateContects")]
|
||||
public async Task<IActionResult> PostQuery([FromBody]ContactViewModel model)
|
||||
{
|
||||
if(!ModelState.IsValid)
|
||||
return BadRequest(ModelState);
|
||||
|
||||
var result = await _context.Contacts.AddAsync(new Model.Contact
|
||||
{
|
||||
Name = model.Name,
|
||||
Email = model.Email,
|
||||
Message = model.Query ??= string.Empty
|
||||
});
|
||||
return Created(string.Empty, result);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("GetContacts")]
|
||||
public async Task<List<ContactViewModel>> GetContacts()
|
||||
{
|
||||
var result = await _context.Contacts.Select(a => new ContactViewModel
|
||||
{
|
||||
Email = a.Email,
|
||||
Name = a.Name,
|
||||
Query = a.Message
|
||||
}).ToListAsync();
|
||||
return result;
|
||||
}
|
||||
}
|
60
src/Services/Contact/Contact.API/Dockerfile
Normal file
60
src/Services/Contact/Contact.API/Dockerfile
Normal file
@ -0,0 +1,60 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
WORKDIR /src
|
||||
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
|
||||
|
||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
|
||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
|
||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
|
||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
|
||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
|
||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
|
||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
|
||||
COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj"
|
||||
COPY "Services/Basket/Basket.API/Basket.API.csproj" "Services/Basket/Basket.API/Basket.API.csproj"
|
||||
COPY "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj" "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj"
|
||||
COPY "Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj" "Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj"
|
||||
COPY "Services/Catalog/Catalog.API/Catalog.API.csproj" "Services/Catalog/Catalog.API/Catalog.API.csproj"
|
||||
COPY "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj"
|
||||
COPY "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj"
|
||||
COPY "Services/Identity/Identity.API/Identity.API.csproj" "Services/Identity/Identity.API/Identity.API.csproj"
|
||||
COPY "Services/Ordering/Ordering.API/Ordering.API.csproj" "Services/Ordering/Ordering.API/Ordering.API.csproj"
|
||||
COPY "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj"
|
||||
COPY "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj"
|
||||
COPY "Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj" "Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj"
|
||||
COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj" "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
||||
COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj"
|
||||
COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj"
|
||||
COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj"
|
||||
|
||||
COPY "docker-compose.dcproj" "docker-compose.dcproj"
|
||||
|
||||
COPY "Directory.Packages.props" "Directory.Packages.props"
|
||||
COPY "NuGet.config" "NuGet.config"
|
||||
|
||||
RUN dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
||||
|
||||
COPY . .
|
||||
WORKDIR "/src/Services/Contact/Contact.API"
|
||||
RUN dotnet publish --no-restore -c Release -o /app
|
||||
|
||||
FROM build AS publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
ENTRYPOINT ["dotnet", "Contact.API.dll"]
|
53
src/Services/Contact/Contact.API/Migrations/20230724050259_initilasation.Designer.cs
generated
Normal file
53
src/Services/Contact/Contact.API/Migrations/20230724050259_initilasation.Designer.cs
generated
Normal file
@ -0,0 +1,53 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Contact.API.Model;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Contact.API.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDBContext))]
|
||||
[Migration("20230724050259_initilasation")]
|
||||
partial class Initilasation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Contact.API.Model.Contact", b =>
|
||||
{
|
||||
b.Property<Guid>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Contacts");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Contact.API.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Initilasation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Contacts",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Message = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Contacts", x => x.ID);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Contacts");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Contact.API.Model;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Contact.API.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDBContext))]
|
||||
partial class ApplicationDBContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Contact.API.Model.Contact", b =>
|
||||
{
|
||||
b.Property<Guid>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Contacts");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace Contact.API.Model;
|
||||
|
||||
public class ApplicationDBContext : DbContext
|
||||
{
|
||||
public ApplicationDBContext(DbContextOptions<ApplicationDBContext> option) : base(option) { }
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
base.Database.EnsureCreated();
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
||||
public DbSet<Contact> Contacts { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class DbContextFactory : IDesignTimeDbContextFactory<ApplicationDBContext>
|
||||
{
|
||||
public ApplicationDBContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<ApplicationDBContext>();
|
||||
optionsBuilder.UseSqlServer("Server=.;Initial Catalog=Microsoft.eShopOnContainers.Services.ContactDb;Integrated Security=true");
|
||||
|
||||
return new ApplicationDBContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
18
src/Services/Contact/Contact.API/Model/Contact.cs
Normal file
18
src/Services/Contact/Contact.API/Model/Contact.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Contact.API.Model;
|
||||
|
||||
public class Contact
|
||||
{
|
||||
[Key]
|
||||
public Guid ID { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Message { get; set; }
|
||||
}
|
29
src/Services/Contact/Contact.API/Program.cs
Normal file
29
src/Services/Contact/Contact.API/Program.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Contact.API.Model;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.
|
||||
AddSqlServer<ApplicationDBContext>("server=127.0.0.1,5433;Initial Catalog=Microsoft.eShopOnContainers.Services.ContactDb;User Id=sa;Password=Pass@word;Encrypt=false");
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
@ -0,0 +1,38 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Contact.API": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "https://localhost:7237;http://localhost:5118"
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
||||
"publishAllPorts": true,
|
||||
"useSSL": true
|
||||
}
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:37689",
|
||||
"sslPort": 44355
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Contact.API.ViewModel;
|
||||
|
||||
public class ContactViewModel
|
||||
{
|
||||
[Required]
|
||||
[StringLength(maximumLength: 100, MinimumLength = 3)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public required string Email { get; set; }
|
||||
|
||||
[StringLength(1000)]
|
||||
public string? Query { get; set; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
9
src/Services/Contact/Contact.API/appsettings.json
Normal file
9
src/Services/Contact/Contact.API/appsettings.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,12 +1,6 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Data.Common;
|
||||
global using System.Data.Common;
|
||||
global using System.Data.SqlClient;
|
||||
global using System.IO;
|
||||
global using System.Linq;
|
||||
global using System.Runtime.Serialization;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
global using Azure.Identity;
|
||||
global using Dapper;
|
||||
global using FluentValidation;
|
||||
@ -14,9 +8,6 @@ global using Google.Protobuf.Collections;
|
||||
global using Grpc.Core;
|
||||
global using MediatR;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Design;
|
||||
@ -45,9 +36,6 @@ global using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.Extensions.Options;
|
||||
global using Polly;
|
||||
global using Polly.Retry;
|
||||
|
@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<RootNamespace>Microsoft.eShopOnContainers.Services.Ordering.API</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,10 +1,8 @@
|
||||
global using System;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Hosting;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Ordering.BackgroundTasks;
|
||||
global using Ordering.BackgroundTasks.Extensions;
|
||||
global using Ordering.BackgroundTasks.Services;
|
||||
global using Services.Common;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
@ -1,12 +1,7 @@
|
||||
global using global::Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
|
||||
global using System.Reflection;
|
||||
global using global::Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
|
||||
global using MediatR;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Reflection;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Threading;
|
||||
global using System;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,17 +1,12 @@
|
||||
global using MediatR;
|
||||
global using System.Data;
|
||||
global using MediatR;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Design;
|
||||
global using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
global using Microsoft.EntityFrameworkCore.Storage;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||
global using System.Data;
|
||||
global using System.Linq;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Threading;
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -33,6 +33,7 @@ COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Service
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
||||
|
@ -1,9 +1,5 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
global using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.SignalR;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
@ -11,7 +7,4 @@ global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Services.Common;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,11 +1,7 @@
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using Microsoft.eShopOnContainers.Payment.API;
|
||||
global using Microsoft.eShopOnContainers.Payment.API.IntegrationEvents.EventHandling;
|
||||
global using Microsoft.eShopOnContainers.Payment.API.IntegrationEvents.Events;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.Extensions.Options;
|
||||
global using Services.Common;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY ["Services/Contact/Contact.API/Contact.API.csproj", "Services/Contact/Contact.API/Contact.API.csproj"]
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,26 +1,16 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.ComponentModel.DataAnnotations;
|
||||
global using System.ComponentModel.DataAnnotations;
|
||||
global using System.Data.Common;
|
||||
global using System.Linq;
|
||||
global using System.Net;
|
||||
global using System.Net.Http;
|
||||
global using System.Text;
|
||||
global using System.Text.Json;
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Design;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
global using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Services.Common;
|
||||
global using Webhooks.API.Infrastructure;
|
||||
global using Webhooks.API.IntegrationEvents;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
global using System;
|
||||
global using System.Net.Http;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using System.Security.Claims;
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.eShopOnContainers.Services.Basket.API.Model;
|
||||
global using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||
global using System.Text.Json;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Net.Http;
|
||||
global using System.Security.Claims;
|
||||
global using System.Text;
|
||||
global using System.Text.Json;
|
||||
global using System.Threading.Tasks;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.eShopOnContainers.Services.Basket.API.Model;
|
||||
global using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||
global using WebMVC.Services.ModelDTOs;
|
||||
global using Xunit;
|
||||
|
||||
|
@ -33,6 +33,7 @@ COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Service
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
||||
|
@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<UserSecretsId>aspnet-Microsoft.eShopOnContainers-946ae052-8305-4a99-965b-ec8636ddbae3</UserSecretsId>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<TypeScriptToolsVersion>3.0</TypeScriptToolsVersion>
|
||||
</PropertyGroup>
|
||||
|
@ -3,7 +3,6 @@
|
||||
public class AppSettings
|
||||
{
|
||||
public string IdentityUrl { get; set; }
|
||||
public string BasketUrl { get; set; }
|
||||
public string MarketingUrl { get; set; }
|
||||
|
||||
public string PurchaseUrl { get; set; }
|
||||
|
@ -44,6 +44,7 @@ COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Service
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj"
|
||||
|
12
src/Web/WebSPA/Extensions/Extensions.cs
Normal file
12
src/Web/WebSPA/Extensions/Extensions.cs
Normal file
@ -0,0 +1,12 @@
|
||||
internal static class Extensions
|
||||
{
|
||||
public static IServiceCollection AddHealthChecks(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var hcBuilder = services.AddHealthChecks();
|
||||
|
||||
hcBuilder
|
||||
.AddUrlGroup(_ => new Uri(configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" });
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
@ -1,24 +1,6 @@
|
||||
global using eShopConContainers.WebSPA;
|
||||
global using Microsoft.AspNetCore;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using System.IO;
|
||||
global using System.IO.Compression;
|
||||
global using eShopOnContainers.WebSPA;
|
||||
global using HealthChecks.UI.Client;
|
||||
global using Microsoft.AspNetCore.Antiforgery;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.DataProtection;
|
||||
global using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.AspNetCore.SpaServices.AngularCli;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
global using Microsoft.Extensions.Hosting;
|
||||
global using StackExchange.Redis;
|
||||
global using System;
|
||||
global using WebSPA.Infrastructure;
|
||||
global using Microsoft.Extensions.Options;
|
||||
global using System.IO.Compression;
|
||||
global using System.Linq;
|
||||
global using Services.Common;
|
||||
global using WebSPA.Infrastructure;
|
||||
|
@ -1,78 +1,21 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.WebHost.UseContentRoot(Directory.GetCurrentDirectory());
|
||||
|
||||
builder.Services.AddApplicationInsightsTelemetry(builder.Configuration);
|
||||
builder.Services.AddApplicationInsightsKubernetesEnricher();
|
||||
builder.Services.AddHealthChecks()
|
||||
.AddCheck("self", () => HealthCheckResult.Healthy())
|
||||
.AddUrlGroup(new Uri(builder.Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" });
|
||||
builder.AddServiceDefaults();
|
||||
|
||||
builder.Services.AddHealthChecks(builder.Configuration);
|
||||
builder.Services.Configure<AppSettings>(builder.Configuration);
|
||||
if (builder.Configuration.GetValue<string>("IsClusterEnv") == bool.TrueString)
|
||||
{
|
||||
builder.Services.AddDataProtection(opts =>
|
||||
{
|
||||
opts.ApplicationDiscriminator = "eshop.webspa";
|
||||
})
|
||||
.PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(builder.Configuration["DPConnectionString"]), "DataProtection-Keys");
|
||||
}
|
||||
|
||||
|
||||
// Add Anti-forgery services and configure the header name that angular will use by default.
|
||||
builder.Services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN");
|
||||
|
||||
// Add controllers support and add a global AutoValidateAntiforgeryTokenFilter that will make the application check for an Anti-forgery token on all "mutating" requests (POST, PUT, DELETE).
|
||||
// The AutoValidateAntiforgeryTokenFilter is an internal class registered when we register views, so we need to register controllers and views also.
|
||||
builder.Services.AddControllersWithViews(options => options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()))
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
|
||||
});
|
||||
|
||||
// Setup where the compiled version of our spa application will be, when in production.
|
||||
builder.Services.AddSpaStaticFiles(configuration =>
|
||||
builder.Services.AddSpaStaticFiles(options =>
|
||||
{
|
||||
configuration.RootPath = "wwwroot";
|
||||
options.RootPath = "wwwroot";
|
||||
});
|
||||
|
||||
builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging"));
|
||||
builder.Logging.AddAzureWebAppDiagnostics();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Here we add Angular default Anti-forgery cookie name on first load. https://angular.io/guide/http#security-xsrf-protection
|
||||
// This cookie will be read by Angular app and its value will be sent back to the application as the header configured in .AddAntiforgery()
|
||||
var antiForgery = app.Services.GetRequiredService<IAntiforgery>();
|
||||
app.Use(next => context =>
|
||||
{
|
||||
string path = context.Request.Path.Value;
|
||||
app.UseServiceDefaults();
|
||||
|
||||
if (string.Equals(path, "/", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(path, "/index.html", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// The request token has to be sent as a JavaScript-readable cookie,
|
||||
// and Angular uses it by default.
|
||||
var tokens = antiForgery.GetAndStoreTokens(context);
|
||||
context.Response.Cookies.Append("XSRF-TOKEN", tokens.RequestToken,
|
||||
new CookieOptions() { HttpOnly = false });
|
||||
}
|
||||
|
||||
return next(context);
|
||||
});
|
||||
|
||||
// Seed Data
|
||||
WebContextSeed.Seed(app, app.Environment, app.Services.GetRequiredService<ILogger<WebContextSeed>>());
|
||||
|
||||
var pathBase = app.Configuration["PATH_BASE"];
|
||||
|
||||
if (!string.IsNullOrEmpty(pathBase))
|
||||
{
|
||||
app.Services.GetRequiredService<ILogger<WebContextSeed>>().LogDebug("Using PATH_BASE '{PathBase}'", pathBase);
|
||||
app.UsePathBase(pathBase);
|
||||
}
|
||||
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
app.UseFileServer();
|
||||
|
||||
// This will make the application to respond with the index.html and the rest of the assets present on the configured folder (at AddSpaStaticFiles() (wwwroot))
|
||||
if (!app.Environment.IsDevelopment())
|
||||
@ -81,16 +24,12 @@ if (!app.Environment.IsDevelopment())
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
app.MapDefaultControllerRoute();
|
||||
app.MapControllers();
|
||||
app.MapHealthChecks("/liveness", new HealthCheckOptions
|
||||
|
||||
#pragma warning disable ASP0014 // Suggest using top level route registrations
|
||||
app.UseEndpoints(routes =>
|
||||
{
|
||||
Predicate = r => r.Name.Contains("self")
|
||||
});
|
||||
app.MapHealthChecks("/hc", new HealthCheckOptions()
|
||||
{
|
||||
Predicate = _ => true,
|
||||
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
|
||||
// TODO: Change this route
|
||||
routes.MapGet("/home/configuration", (IOptions<AppSettings> options) => options.Value);
|
||||
});
|
||||
|
||||
// Handles all still unattended (by any other middleware) requests by returning the default page of the SPA (wwwroot/index.html).
|
||||
@ -109,4 +48,7 @@ app.UseSpa(spa =>
|
||||
}
|
||||
});
|
||||
|
||||
// Seed Data
|
||||
WebContextSeed.Seed(app, app.Environment, app.Logger);
|
||||
|
||||
await app.RunAsync();
|
||||
|
@ -1,24 +1,5 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:58018/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"publishAllPorts": true
|
||||
},
|
||||
"WebSPA": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
@ -27,6 +8,11 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5104"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"publishAllPorts": true
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
|
||||
namespace eShopConContainers.WebSPA.Server.Controllers;
|
||||
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly IWebHostEnvironment _env;
|
||||
private readonly IOptionsSnapshot<AppSettings> _settings;
|
||||
|
||||
public HomeController(IWebHostEnvironment env, IOptionsSnapshot<AppSettings> settings)
|
||||
{
|
||||
_env = env;
|
||||
_settings = settings;
|
||||
}
|
||||
public IActionResult Configuration()
|
||||
{
|
||||
return Json(_settings.Value);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
|
||||
|
||||
public class WebContextSeed
|
||||
{
|
||||
public static void Seed(IApplicationBuilder applicationBuilder, IWebHostEnvironment env, ILogger<WebContextSeed> logger)
|
||||
public static void Seed(IApplicationBuilder applicationBuilder, IWebHostEnvironment env, ILogger logger)
|
||||
{
|
||||
var settings = applicationBuilder
|
||||
.ApplicationServices.GetRequiredService<IOptions<AppSettings>>().Value;
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
|
||||
<TypeScriptCompileOnSaveEnabled>false</TypeScriptCompileOnSaveEnabled>
|
||||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||
<GeneratedItemPatterns>wwwroot/dist/**</GeneratedItemPatterns>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(GeneratedItemPatterns)</DefaultItemExcludes>
|
||||
@ -22,26 +22,20 @@
|
||||
<Content Update="appsettings.json;">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Update="web.config;">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\**\*;">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Uris" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
|
||||
<PackageReference Include="Newtonsoft.Json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Services\Services.Common\Services.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
||||
|
@ -1,24 +1,19 @@
|
||||
{
|
||||
"IdentityUrl": "http://host.docker.internal:5105",
|
||||
"CallBackUrl": "http://host.docker.internal:5104/",
|
||||
"BasketUrl" : "http://host.docker.internal:5103",
|
||||
"PurchaseUrl": "http://host.docker.internal:5202",
|
||||
"PurchaseUrlHC": "http://host.docker.internal:5202/hc",
|
||||
"IdentityUrlHC": "http://host.docker.internal:5105/hc",
|
||||
"SignalrHubUrl": "http://host.docker.internal:5112",
|
||||
"UseCustomizationData": true,
|
||||
"IsClusterEnv": "False",
|
||||
"ActivateCampaignDetailFunction": false,
|
||||
"Logging": {
|
||||
"Console": {
|
||||
"IncludeScopes": false
|
||||
},
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"IdentityUrl": "http://localhost:5223",
|
||||
"CallBackUrl": "http://localhost:5331/",
|
||||
"PurchaseUrl": "http://localhost:5229",
|
||||
"PurchaseUrlHC": "http://localhost:5229/hc",
|
||||
"IdentityUrlHC": "http://localhost:5223/hc",
|
||||
"SignalrHubUrl": "http://localhost:5229",
|
||||
"UseCustomizationData": true,
|
||||
"IsClusterEnv": false,
|
||||
"ActivateCampaignDetailFunction": false,
|
||||
"ApplicationInsights": {
|
||||
"InstrumentationKey": ""
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!--
|
||||
Configure your application settings in appsettings.json. Learn more at https://go.microsoft.com/fwlink/?LinkId=786380
|
||||
-->
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||
</handlers>
|
||||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" hostingModel="InProcess">
|
||||
<environmentVariables />
|
||||
</aspNetCore>
|
||||
</system.webServer>
|
||||
</configuration>
|
@ -32,6 +32,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -1,13 +1,5 @@
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using System.Linq;
|
||||
global using Microsoft.AspNetCore.Hosting;
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using Azure.Core;
|
||||
global using Azure.Identity;
|
||||
global using Azure.Core;
|
||||
global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
global using Microsoft.Extensions.Hosting;
|
||||
|
@ -1,9 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
|
||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -33,6 +33,7 @@ COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj"
|
||||
COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj"
|
||||
COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj"
|
||||
COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj"
|
||||
COPY "Services/Contact/Contact.API/Contact.API.csproj" "Services/Contact/Contact.API/Contact.API.csproj"
|
||||
COPY "Services/Services.Common/Services.Common.csproj" "Services/Services.Common/Services.Common.csproj"
|
||||
COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj"
|
||||
COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj"
|
||||
|
@ -2,12 +2,9 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<UserSecretsId>36215d41-f31a-4aa6-9929-bd67d650e7b5</UserSecretsId>
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
|
||||
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
||||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>fea0c318-ffed-4d39-8781-265718ca43dd</ProjectGuid>
|
||||
<DockerLaunchBrowser>True</DockerLaunchBrowser>
|
||||
<DockerServiceUrl>http://host.docker.internal:5100</DockerServiceUrl>
|
||||
<DockerServiceUrl>http://localhost:5100</DockerServiceUrl>
|
||||
<DockerServiceName>webmvc</DockerServiceName>
|
||||
<DockerTargetOS>Linux</DockerTargetOS>
|
||||
<ProjectVersion>2.1</ProjectVersion>
|
||||
|
@ -33,6 +33,7 @@ services:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- eshop-basketdata:/data
|
||||
|
||||
rabbitmq:
|
||||
ports:
|
||||
- "15672:15672"
|
||||
@ -52,6 +53,7 @@ services:
|
||||
- WebShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121
|
||||
- WebhooksApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5113
|
||||
- WebhooksWebClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5114
|
||||
- ContactApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5106
|
||||
- UseCustomizationData=True
|
||||
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
|
||||
- OrchestratorType=${ORCHESTRATOR_TYPE}
|
||||
@ -155,7 +157,16 @@ services:
|
||||
- OrchestratorType=${ORCHESTRATOR_TYPE}
|
||||
ports:
|
||||
- "5108:80"
|
||||
|
||||
|
||||
contect-api:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- ConnectionStrings__CatalogDb=${ESHOP_AZURE_CATALOG_DB:-Server=sqldata;Database=Microsoft.eShopOnContainers.Services.ContactDb;User Id=sa;Password=Pass@word;Encrypt=False;TrustServerCertificate=true}
|
||||
- OrchestratorType=${ORCHESTRATOR_TYPE}
|
||||
ports:
|
||||
- "5106:80"
|
||||
|
||||
webhooks-api:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
@ -169,20 +180,6 @@ services:
|
||||
ports:
|
||||
- "5113:80"
|
||||
|
||||
mobileshoppingapigw:
|
||||
volumes:
|
||||
- ./ApiGateways/Envoy/config/mobileshopping:/etc/envoy
|
||||
ports:
|
||||
- "5200:80"
|
||||
- "15200:8001"
|
||||
|
||||
webshoppingapigw:
|
||||
volumes:
|
||||
- ./ApiGateways/Envoy/config/webshopping:/etc/envoy
|
||||
ports:
|
||||
- "5202:80"
|
||||
- "15202:8001"
|
||||
|
||||
mobileshoppingagg:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
@ -276,13 +273,13 @@ services:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- Identity__Url=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
|
||||
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121
|
||||
- IdentityUrlHC=http://identity-api/hc
|
||||
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121
|
||||
- UseCustomizationData=True
|
||||
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
|
||||
- OrchestratorType=${ORCHESTRATOR_TYPE}
|
||||
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
|
||||
ports:
|
||||
- "5104:80"
|
||||
|
||||
|
@ -111,7 +111,7 @@ services:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- Identity__Url=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- PurchaseUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5202
|
||||
- CatalogUrlHC=http://catalog-api/hc
|
||||
- OrderingUrlHC=http://ordering-api/hc
|
||||
@ -128,7 +128,7 @@ services:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- PurchaseUrl=http://webshoppingapigw
|
||||
- PurchaseUrl=http://webshoppingagg
|
||||
- IdentityUrl=http://10.0.75.1:5105 # Local Mac: Use http://docker.for.mac.localhost:5105 || Local Windows: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. || #Remote access: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser.
|
||||
- CatalogUrlHC=http://catalog-api/hc
|
||||
- OrderingUrlHC=http://ordering-api/hc
|
||||
@ -191,26 +191,6 @@ services:
|
||||
- "15672:15672" # Important: In a production environment your should remove the external port
|
||||
- "5672:5672" # Important: In a production environment your should remove the external port
|
||||
|
||||
mobileshoppingapigw:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- IdentityUrl=http://identity-api #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
ports:
|
||||
- "5200:80" # Important: In a production environment your should remove the external port (5200) kept here for microservice debugging purposes.
|
||||
# The API Gateway redirects and access through the internal port (80).
|
||||
volumes:
|
||||
- ./ApiGateways/Mobile.Bff.Shopping/apigw:/app/configuration
|
||||
|
||||
webshoppingapigw:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- IdentityUrl=http://identity-api #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
ports:
|
||||
- "5202:80" # Important: In a production environment your should remove the external port (5202) kept here for microservice debugging purposes.
|
||||
# The API Gateway redirects and access through the internal port (80).
|
||||
volumes:
|
||||
- ./ApiGateways/Web.Bff.Shopping/apigw:/app/configuration
|
||||
|
||||
mobileshoppingagg:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
|
@ -1,32 +1,31 @@
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
|
||||
seq:
|
||||
image: datalust/seq:latest
|
||||
|
||||
image: 'datalust/seq:latest'
|
||||
sqldata:
|
||||
image: mcr.microsoft.com/mssql/server:2019-latest
|
||||
|
||||
image: 'mcr.microsoft.com/mssql/server:2019-latest'
|
||||
nosqldata:
|
||||
image: mongo
|
||||
|
||||
basketdata:
|
||||
image: redis:alpine
|
||||
|
||||
image: 'redis:alpine'
|
||||
rabbitmq:
|
||||
image: rabbitmq:3-management-alpine
|
||||
|
||||
image: 'rabbitmq:3-management-alpine'
|
||||
identity-api:
|
||||
image: ${REGISTRY:-eshop}/identity.api:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/identity.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Identity/Identity.API/Dockerfile
|
||||
depends_on:
|
||||
- sqldata
|
||||
|
||||
contect-api:
|
||||
image: '${REGISTRY:-eshop}/contect.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Contact/Contact.API/Dockerfile
|
||||
depends_on:
|
||||
- sqldata
|
||||
basket-api:
|
||||
image: ${REGISTRY:-eshop}/basket.api:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/basket.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Basket/Basket.API/Dockerfile
|
||||
@ -34,55 +33,46 @@ services:
|
||||
- basketdata
|
||||
- identity-api
|
||||
- rabbitmq
|
||||
|
||||
catalog-api:
|
||||
image: ${REGISTRY:-eshop}/catalog.api:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/catalog.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Catalog/Catalog.API/Dockerfile
|
||||
depends_on:
|
||||
- sqldata
|
||||
- rabbitmq
|
||||
|
||||
ordering-api:
|
||||
image: ${REGISTRY:-eshop}/ordering.api:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/ordering.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Ordering/Ordering.API/Dockerfile
|
||||
depends_on:
|
||||
- sqldata
|
||||
- rabbitmq
|
||||
|
||||
ordering-backgroundtasks:
|
||||
image: ${REGISTRY:-eshop}/ordering.backgroundtasks:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/ordering.backgroundtasks:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Ordering/Ordering.BackgroundTasks/Dockerfile
|
||||
depends_on:
|
||||
- sqldata
|
||||
- rabbitmq
|
||||
|
||||
payment-api:
|
||||
image: ${REGISTRY:-eshop}/payment.api:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/payment.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Payment/Payment.API/Dockerfile
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
|
||||
webhooks-api:
|
||||
image: ${REGISTRY:-eshop}/webhooks.api:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/webhooks.api:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Webhooks/Webhooks.API/Dockerfile
|
||||
depends_on:
|
||||
- sqldata
|
||||
|
||||
mobileshoppingapigw:
|
||||
image: envoyproxy/envoy:v1.11.1
|
||||
|
||||
mobileshoppingagg:
|
||||
image: ${REGISTRY:-eshop}/mobileshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/mobileshoppingagg:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
|
||||
@ -94,9 +84,8 @@ services:
|
||||
- ordering-api
|
||||
- catalog-api
|
||||
- basket-api
|
||||
|
||||
webshoppingagg:
|
||||
image: ${REGISTRY:-eshop}/webshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/webshoppingagg:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
|
||||
@ -108,9 +97,8 @@ services:
|
||||
- ordering-api
|
||||
- catalog-api
|
||||
- basket-api
|
||||
|
||||
ordering-signalrhub:
|
||||
image: ${REGISTRY:-eshop}/ordering.signalrhub:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/ordering.signalrhub:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Services/Ordering/Ordering.SignalrHub/Dockerfile
|
||||
@ -122,39 +110,31 @@ services:
|
||||
- ordering-api
|
||||
- catalog-api
|
||||
- basket-api
|
||||
|
||||
webstatus:
|
||||
image: ${REGISTRY:-eshop}/webstatus:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/webstatus:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Web/WebStatus/Dockerfile
|
||||
|
||||
webspa:
|
||||
image: ${REGISTRY:-eshop}/webspa:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/webspa:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Web/WebSPA/Dockerfile
|
||||
args:
|
||||
NODE_IMAGE: ${NODE_IMAGE:-node:16-bullseye}
|
||||
NODE_IMAGE: '${NODE_IMAGE:-node:16-bullseye}'
|
||||
depends_on:
|
||||
- webshoppingagg
|
||||
- webshoppingapigw
|
||||
|
||||
webmvc:
|
||||
image: ${REGISTRY:-eshop}/webmvc:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/webmvc:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Web/WebMVC/Dockerfile
|
||||
depends_on:
|
||||
- webshoppingagg
|
||||
|
||||
webhooks-client:
|
||||
image: ${REGISTRY:-eshop}/webhooks.client:${PLATFORM:-linux}-${TAG:-latest}
|
||||
image: '${REGISTRY:-eshop}/webhooks.client:${PLATFORM:-linux}-${TAG:-latest}'
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Web/WebhookClient/Dockerfile
|
||||
depends_on:
|
||||
- webhooks-api
|
||||
|
||||
webshoppingapigw:
|
||||
image: envoyproxy/envoy:v1.11.1
|
||||
|
@ -103,17 +103,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webhooks.API", "Services\We
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebhookClient", "Web\WebhookClient\WebhookClient.csproj", "{766D7E92-6AF0-476C-ADD5-282BF4D8C576}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Envoy", "Envoy", "{882A8F3A-C61F-4C44-86DD-A5A258714BF2}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{3ABEEE8C-35E0-4185-9825-C44326151F5B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.BackgroundTasks", "Services\Ordering\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj", "{D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webshopping", "webshopping", "{966B1B0B-2AE0-4438-8741-1C5A05556095}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
ApiGateways\Envoy\config\webshopping\envoy.yaml = ApiGateways\Envoy\config\webshopping\envoy.yaml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile.Bff.Shopping", "Mobile.Bff.Shopping", "{798BFC44-2CCD-45FA-B37A-5173B03C2B30}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mobile.Shopping.HttpAggregator", "ApiGateways\Mobile.Bff.Shopping\aggregator\Mobile.Shopping.HttpAggregator.csproj", "{B62E859F-825E-4C8B-93EC-5966EACFD026}"
|
||||
@ -126,6 +117,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Services.Common", "Services
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{42B85D0F-2ED6-4C00-91FA-103DACC3D5E2}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contact", "Contact", "{C7684980-DC20-4957-85E4-92363C252256}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contact.API", "Services\Contact\Contact.API\Contact.API.csproj", "{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
||||
@ -1532,6 +1527,54 @@ Global
|
||||
{CD430CE4-D5E0-4C96-84F5-AEC9162651B5}.Release|x64.Build.0 = Release|Any CPU
|
||||
{CD430CE4-D5E0-4C96-84F5-AEC9162651B5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CD430CE4-D5E0-4C96-84F5-AEC9162651B5}.Release|x86.Build.0 = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|ARM.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|ARM.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|iPhone.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|x64.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|x64.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|x86.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.AppStore|x86.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|x64.Build.0 = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -1580,16 +1623,15 @@ Global
|
||||
{E0AA11C4-2873-461D-8F82-53392530FB7A} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
|
||||
{84E2016E-0435-44C6-8020-3D288AA38B2C} = {E0AA11C4-2873-461D-8F82-53392530FB7A}
|
||||
{766D7E92-6AF0-476C-ADD5-282BF4D8C576} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
|
||||
{882A8F3A-C61F-4C44-86DD-A5A258714BF2} = {77849D35-37D4-4802-81DC-9477B2775A40}
|
||||
{3ABEEE8C-35E0-4185-9825-C44326151F5B} = {882A8F3A-C61F-4C44-86DD-A5A258714BF2}
|
||||
{D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
|
||||
{966B1B0B-2AE0-4438-8741-1C5A05556095} = {3ABEEE8C-35E0-4185-9825-C44326151F5B}
|
||||
{798BFC44-2CCD-45FA-B37A-5173B03C2B30} = {77849D35-37D4-4802-81DC-9477B2775A40}
|
||||
{B62E859F-825E-4C8B-93EC-5966EACFD026} = {798BFC44-2CCD-45FA-B37A-5173B03C2B30}
|
||||
{373D8AA1-36BE-49EC-89F0-6CB736666285} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F}
|
||||
{95D735BE-2899-4495-BE3F-2600E93B4E3C} = {373D8AA1-36BE-49EC-89F0-6CB736666285}
|
||||
{CD430CE4-D5E0-4C96-84F5-AEC9162651B5} = {42B85D0F-2ED6-4C00-91FA-103DACC3D5E2}
|
||||
{42B85D0F-2ED6-4C00-91FA-103DACC3D5E2} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
|
||||
{C7684980-DC20-4957-85E4-92363C252256} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
|
||||
{D02363DB-3F96-4DA7-BB18-B2DEE08BF3C3} = {C7684980-DC20-4957-85E4-92363C252256}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}
|
||||
|
@ -9,7 +9,6 @@
|
||||
"catalog-api": "StartDebugging",
|
||||
"identity-api": "StartDebugging",
|
||||
"mobileshoppingagg": "StartDebugging",
|
||||
"mobileshoppingapigw": "StartWithoutDebugging",
|
||||
"nosqldata": "StartWithoutDebugging",
|
||||
"ordering-api": "StartDebugging",
|
||||
"ordering-backgroundtasks": "StartDebugging",
|
||||
@ -22,7 +21,6 @@
|
||||
"webhooks-client": "StartDebugging",
|
||||
"webmvc": "StartDebugging",
|
||||
"webshoppingagg": "StartDebugging",
|
||||
"webshoppingapigw": "StartWithoutDebugging",
|
||||
"webspa": "StartDebugging",
|
||||
"webstatus": "StartDebugging"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user