From 24e7f8c6f286a890c9500ec890c7212867acfa50 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 30 Mar 2022 21:37:54 +0300 Subject: [PATCH] added environment files for Docker --- .../EShopOnAbpAuthServerModule.cs | 1 + .../appsettings.Docker.json | 42 ++++++++++++ .../appsettings.Docker.json | 60 +++++++++++++++++ .../appsettings.Docker.json | 51 +++++++++++++++ .../appsettings.Docker.json | 35 ++++++++++ .../appsettings.Docker.json | 46 +++++++++++++ .../appsettings.Docker.json | 65 +++++++++++++++++++ .../appsettings.Docker.json | 30 +++++++++ 8 files changed, 330 insertions(+) create mode 100644 apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.Docker.json create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.Docker.json create mode 100644 services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.Docker.json create mode 100644 services/basket/src/EShopOnAbp.BasketService/appsettings.Docker.json create mode 100644 services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.Docker.json create mode 100644 services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Docker.json create mode 100644 services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.Docker.json diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs b/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs index 8b57f016..11f59d6e 100644 --- a/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs @@ -185,6 +185,7 @@ public class EShopOnAbpAuthServerModule : AbpModule app.UseJwtTokenMiddleware(); app.UseAbpSerilogEnrichers(); app.UseUnitOfWork(); + app.UseForwardedHeaders(); app.UseIdentityServer(); app.UseAuthorization(); app.UseSwagger(); diff --git a/apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.Docker.json b/apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.Docker.json new file mode 100644 index 00000000..211c73ff --- /dev/null +++ b/apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.Docker.json @@ -0,0 +1,42 @@ +{ + "App": { + "SelfUrl": "https://app-authserver", + "CorsOrigins": "http://app-web,https://identity-service,https://administration-service,https://catalog-service,https://basket-service,https://ordering-service,https://payment-service", + "RedirectAllowedUrls": "http://app-web" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "IdentityService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Identity;Pooling=false;", + "AdministrationService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Administration;Pooling=false;" + }, + "StringEncryption": { + "DefaultPassPhrase": "gsKnGZ041HLL4IM8" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_AuthServer", + "ExchangeName": "EShopOnAbp" + } + } +} diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.Docker.json b/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.Docker.json new file mode 100644 index 00000000..9eb3dd5b --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.Docker.json @@ -0,0 +1,60 @@ +{ + "App": { + "SelfUrl": "https://app-publicweb" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*", + "RemoteServices": { + "Default": { + "BaseUrl": "http://gateway-web-public" + } + }, + "StringEncryption": { + "DefaultPassPhrase": "gsKnGZ041HLL4IM8" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_PublicWeb", + "ExchangeName": "EShopOnAbp" + } + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "ClientId": "PublicWeb", + "ClientSecret": "1q2w3e*" + }, + "ReverseProxy": { + "Routes": { + "route1" : { + "ClusterId": "cluster1", + "Match": { + "Path": "/api/{**anypath}" + } + } + }, + "Clusters": { + "cluster1": { + "Destinations": { + "destination1": { + "Address": "http://gateway-web-public" + } + } + } + } + } +} \ No newline at end of file diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.Docker.json b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.Docker.json new file mode 100644 index 00000000..3031859f --- /dev/null +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.Docker.json @@ -0,0 +1,51 @@ +{ + "App": { + "SelfUrl": "https://administration-service", + "CorsOrigins": "https://gateway-web,gateway-web-public" + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "RemoteServices": { + "AbpIdentity": { + "BaseUrl": "http://identity-service", + "UseCurrentAccessToken": "false" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "client_credentials", + "ClientId": "EShopOnAbp_AdministrationService", + "ClientSecret": "1q2w3e*", + "Authority": "http://app-authserver", + "Scope": "IdentityService" + } + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "ConnectionStrings": { + "AdministrationService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Administration;Pooling=false;" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_AdministrationService", + "ExchangeName": "EShopOnAbp" + } + } +} diff --git a/services/basket/src/EShopOnAbp.BasketService/appsettings.Docker.json b/services/basket/src/EShopOnAbp.BasketService/appsettings.Docker.json new file mode 100644 index 00000000..b8f4a343 --- /dev/null +++ b/services/basket/src/EShopOnAbp.BasketService/appsettings.Docker.json @@ -0,0 +1,35 @@ +{ + "App": { + "SelfUrl": "https://basket-service", + "CorsOrigins": "https://gateway-web,gateway-web-public" + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "RemoteServices": { + "Catalog": { + "BaseUrl": "https://catalog-service", + "GrpcUrl": "http://catalog-service" + } + }, + "ConnectionStrings": { + "AdministrationService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Administration;Pooling=false;" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_BasketService", + "ExchangeName": "EShopOnAbp" + } + } +} \ No newline at end of file diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.Docker.json b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.Docker.json new file mode 100644 index 00000000..7ec5db5e --- /dev/null +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.Docker.json @@ -0,0 +1,46 @@ +{ + "App": { + "SelfUrl": "https://catalog-service", + "CorsOrigins": "https://gateway-web,gateway-web-public" + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "ConnectionStrings": { + "CatalogService": "mongodb://mongodb/EShopOnAbp_Catalog", + "AdministrationService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Administration;Pooling=false;" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_CatalogService", + "ExchangeName": "EShopOnAbp" + } + }, + "Kestrel": { + "Endpoints": { + "Http": { + "Url": "http://localhost:5000", + "Protocols": "Http1AndHttp2" + }, + "Https": { + "Url": "https://localhost:44354", + "Protocols": "Http1AndHttp2" + }, + "gRPC": { + "Url": "http://localhost:81", + "Protocols": "Http2" + } + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Docker.json b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Docker.json new file mode 100644 index 00000000..0f625175 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Docker.json @@ -0,0 +1,65 @@ +{ + "App": { + "SelfUrl": "https://identity-service", + "CorsOrigins": "https://gateway-web,gateway-web-public" + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "ConnectionStrings": { + "IdentityService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Identity;Pooling=false;", + "AdministrationService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Administration;Pooling=false;" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_IdentityService", + "ExchangeName": "EShopOnAbp" + } + }, + "IdentityServerClients": { + "Web": { + "RootUrl": "http://localhost:4200" + }, + "PublicWeb": { + "RootUrl": "https://localhost:44335/" + }, + "WebGateway": { + "RootUrl": "https://localhost:44372" + }, + "PublicWebGateway": { + "RootUrl": "https://localhost:44373" + }, + "AccountService": { + "RootUrl": "https://localhost:44330" + }, + "IdentityService": { + "RootUrl": "https://localhost:44351" + }, + "AdministrationService": { + "RootUrl": "https://localhost:44353" + }, + "CatalogService": { + "RootUrl": "https://localhost:44354" + }, + "BasketService": { + "RootUrl": "https://localhost:44355" + }, + "OrderingService": { + "RootUrl": "https://localhost:44356" + }, + "PaymentService": { + "RootUrl": "https://localhost:44357" + } + } +} diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.Docker.json b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.Docker.json new file mode 100644 index 00000000..309876d0 --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.Docker.json @@ -0,0 +1,30 @@ +{ + "App": { + "SelfUrl": "https://ordering-service", + "CorsOrigins": "https://gateway-web,gateway-web-public" + }, + "AuthServer": { + "Authority": "http://app-authserver", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "ConnectionStrings": { + "OrderingService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Ordering;Pooling=false", + "AdministrationService": "User ID=postgres;Password=myPassw0rd;Host=postgres-db;Port=5432;Database=EShopOnAbp_Administration;Pooling=false;" + }, + "Redis": { + "Configuration": "redis" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "rabbitmq" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_OrderingService", + "ExchangeName": "EShopOnAbp" + } + } +} \ No newline at end of file