Browse Source

Merge pull request #1 from otter-diku/adz/cleanup-v2

Initial cleanup + disabling the auth
pull/2068/head
kct949 2 years ago
committed by GitHub
parent
commit
fa9e688ea6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 450 additions and 354 deletions
  1. +4
    -4
      src/.env
  2. +7
    -3
      src/Services/Basket/Basket.API/Controllers/BasketController.cs
  3. +28
    -4
      src/Services/Basket/Basket.API/Services/IdentityService.cs
  4. +20
    -1
      src/Services/Basket/Basket.API/Startup.cs
  5. +2
    -2
      src/Services/Identity/Identity.API/SeedData.cs
  6. +1
    -1
      src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs
  7. +34
    -5
      src/Services/Ordering/Ordering.API/Infrastructure/Services/IdentityService.cs
  8. +20
    -1
      src/Services/Ordering/Ordering.API/Startup.cs
  9. +1
    -1
      src/docker-compose-tests.yml
  10. +149
    -148
      src/docker-compose.override.yml
  11. +92
    -92
      src/docker-compose.prod.yml
  12. +1
    -1
      src/docker-compose.windows.yml
  13. +91
    -91
      src/docker-compose.yml

+ 4
- 4
src/.env View File

@ -5,12 +5,12 @@
# The IP below should be swapped to your real IP or DNS name, like 192.168.88.248, etc. if testing from remote browsers or mobile devices
# 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_EXTERNAL_DNS_NAME_OR_IP=host.docker.internal
# ESHOP_STORAGE_CATALOG_URL=http://host.docker.internal:5202/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_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/
# Use this values to run the app locally in Linux
# ESHOP_EXTERNAL_DNS_NAME_OR_IP=docker.for.linux.localhost


+ 7
- 3
src/Services/Basket/Basket.API/Controllers/BasketController.cs View File

@ -1,7 +1,8 @@
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
[Route("api/v1/[controller]")]
[Authorize]
// HACK: no auth
// [Authorize]
[ApiController]
public class BasketController : ControllerBase
{
@ -56,8 +57,11 @@ public class BasketController : ControllerBase
return BadRequest();
}
var userName = this.HttpContext.User.FindFirst(x => x.Type == ClaimTypes.Name).Value;
// HACK: no auth
// Authorization is disabled so the Name claim will not be available
// var userName = this.HttpContext.User.FindFirst(x => x.Type == ClaimTypes.Name).Value;
var userName = "Dummy User Name";
var eventMessage = new UserCheckoutAcceptedIntegrationEvent(userId, userName, basketCheckout.City, basketCheckout.Street,
basketCheckout.State, basketCheckout.Country, basketCheckout.ZipCode, basketCheckout.CardNumber, basketCheckout.CardHolderName,
basketCheckout.CardExpiration, basketCheckout.CardSecurityNumber, basketCheckout.CardTypeId, basketCheckout.Buyer, basketCheckout.RequestId, basket);


+ 28
- 4
src/Services/Basket/Basket.API/Services/IdentityService.cs View File

@ -1,17 +1,41 @@
namespace Microsoft.eShopOnContainers.Services.Basket.API.Services;
public class IdentityService : IIdentityService
public class IdentityServiceFake : IIdentityService
{
private IHttpContextAccessor _context;
public IdentityService(IHttpContextAccessor context)
public IdentityServiceFake(IHttpContextAccessor context)
{
_context = context ?? throw new ArgumentNullException(nameof(context));
}
public string GetUserIdentity()
{
return _context.HttpContext.User.FindFirst("sub").Value;
if (_context.HttpContext
.Request
.Headers
.TryGetValue("user-id", out var value))
{
return value.Single();
}
return null;
}
}
// HACK: no auth
// public class IdentityService : IIdentityService
// {
// private IHttpContextAccessor _context;
//
// public IdentityService(IHttpContextAccessor context)
// {
// _context = context ?? throw new ArgumentNullException(nameof(context));
// }
//
// public string GetUserIdentity()
// {
// return _context.HttpContext.User.FindFirst("sub").Value;
// }
// }

+ 20
- 1
src/Services/Basket/Basket.API/Startup.cs View File

@ -57,6 +57,7 @@ public class Startup
});
options.OperationFilter<AuthorizeCheckOperationFilter>();
options.OperationFilter<AddUserIdHeaderFilter>();
});
ConfigureAuthService(services);
@ -135,7 +136,9 @@ public class Startup
});
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddTransient<IBasketRepository, RedisBasketRepository>();
services.AddTransient<IIdentityService, IdentityService>();
// HACK: no auth
// services.AddTransient<IIdentityService, IdentityService>();
services.AddTransient<IIdentityService, IdentityServiceFake>();
services.AddOptions();
@ -289,4 +292,20 @@ public class Startup
eventBus.Subscribe<ProductPriceChangedIntegrationEvent, ProductPriceChangedIntegrationEventHandler>();
eventBus.Subscribe<OrderStartedIntegrationEvent, OrderStartedIntegrationEventHandler>();
}
// HACK: no auth
private class AddUserIdHeaderFilter : IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
operation.Parameters ??= new List<OpenApiParameter>();
operation.Parameters.Add(new OpenApiParameter
{
Name = "user-id",
In = ParameterLocation.Header,
Required = false
});
}
}
}

+ 2
- 2
src/Services/Identity/Identity.API/SeedData.cs View File

@ -30,7 +30,7 @@ public class SeedData
City = "Redmond",
Country = "U.S.",
Expiration = "12/24",
Id = Guid.NewGuid().ToString(),
Id = "10000000-0000-0000-0000-000000000000",
LastName = "Smith",
Name = "Alice",
PhoneNumber = "1234567890",
@ -69,7 +69,7 @@ public class SeedData
City = "Redmond",
Country = "U.S.",
Expiration = "12/24",
Id = Guid.NewGuid().ToString(),
Id = "20000000-0000-0000-0000-000000000000",
LastName = "Smith",
Name = "Bob",
PhoneNumber = "1234567890",


+ 1
- 1
src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs View File

@ -6,7 +6,7 @@ using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries;
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services;
[Route("api/v1/[controller]")]
[Authorize]
// [Authorize]
[ApiController]
public class OrdersController : ControllerBase
{


+ 34
- 5
src/Services/Ordering/Ordering.API/Infrastructure/Services/IdentityService.cs View File

@ -1,21 +1,50 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services;
public class IdentityService : IIdentityService
public class IdentityServiceFake : IIdentityService
{
private IHttpContextAccessor _context;
public IdentityService(IHttpContextAccessor context)
public IdentityServiceFake(IHttpContextAccessor context)
{
_context = context ?? throw new ArgumentNullException(nameof(context));
}
public string GetUserIdentity()
{
return _context.HttpContext.User.FindFirst("sub").Value;
if (_context.HttpContext
.Request
.Headers
.TryGetValue("user-id", out var value))
{
return value.Single();
}
return null;
}
public string GetUserName()
{
return _context.HttpContext.User.Identity.Name;
return "Dummy User Name";
}
}
// HACK: no auth
// public class IdentityService : IIdentityService
// {
// private IHttpContextAccessor _context;
//
// public IdentityService(IHttpContextAccessor context)
// {
// _context = context ?? throw new ArgumentNullException(nameof(context));
// }
//
// public string GetUserIdentity()
// {
// return _context.HttpContext.User.FindFirst("sub").Value;
// }
//
// public string GetUserName()
// {
// return _context.HttpContext.User.Identity.Name;
// }
// }

+ 20
- 1
src/Services/Ordering/Ordering.API/Startup.cs View File

@ -242,6 +242,7 @@ static class CustomExtensionsMethods
});
options.OperationFilter<AuthorizeCheckOperationFilter>();
options.OperationFilter<AddUserIdHeaderFilter>();
});
return services;
@ -250,7 +251,9 @@ static class CustomExtensionsMethods
public static IServiceCollection AddCustomIntegrations(this IServiceCollection services, IConfiguration configuration)
{
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddTransient<IIdentityService, IdentityService>();
// HACK: no auth
// services.AddTransient<IIdentityService, IdentityService>();
services.AddTransient<IIdentityService, IdentityServiceFake>();
services.AddTransient<Func<DbConnection, IIntegrationEventLogService>>(
sp => (DbConnection c) => new IntegrationEventLogService(c));
@ -398,4 +401,20 @@ static class CustomExtensionsMethods
});
return services;
}
// HACK: no auth
private class AddUserIdHeaderFilter : IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
operation.Parameters ??= new List<OpenApiParameter>();
operation.Parameters.Add(new OpenApiParameter
{
Name = "user-id",
In = ParameterLocation.Header,
Required = false
});
}
}
}

+ 1
- 1
src/docker-compose-tests.yml View File

@ -2,7 +2,7 @@ version: '3.4'
services:
sql-data-test:
image: mcr.microsoft.com/mssql/server:2019-latest
image: mcr.microsoft.com/azure-sql-edge:latest
nosql-data-test:
image: mongo


+ 149
- 148
src/docker-compose.override.yml View File

@ -160,155 +160,156 @@ services:
ports:
- "5108:80"
webhooks-api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_WEBHOOKS_DB:-Server=sqldata;Database=Microsoft.eShopOnContainers.Services.WebhooksDb;User Id=sa;Password=Pass@word;Encrypt=False}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- IdentityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
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
- urls__basket=http://basket-api
- urls__catalog=http://catalog-api
- urls__orders=http://ordering-api
- urls__identity=http://identity-api
- urls__grpcBasket=http://basket-api:81
- urls__grpcCatalog=http://catalog-api:81
- urls__grpcOrdering=http://ordering-api:81
- CatalogUrlHC=http://catalog-api/hc
- OrderingUrlHC=http://ordering-api/hc
- IdentityUrlHC=http://identity-api/hc
- BasketUrlHC=http://basket-api/hc
- PaymentUrlHC=http://payment-api/hc
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
ports:
- "5120:80"
webshoppingagg:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- urls__basket=http://basket-api
- urls__catalog=http://catalog-api
- urls__orders=http://ordering-api
- urls__identity=http://identity-api
- urls__grpcBasket=http://basket-api:81
- urls__grpcCatalog=http://catalog-api:81
- urls__grpcOrdering=http://ordering-api:81
- CatalogUrlHC=http://catalog-api/hc
- OrderingUrlHC=http://ordering-api/hc
- IdentityUrlHC=http://identity-api/hc
- BasketUrlHC=http://basket-api/hc
- PaymentUrlHC=http://payment-api/hc
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
ports:
- "5121:80"
ordering-signalrhub:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureServiceBusEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- identityUrl=http://identity-api
ports:
- "5112:80"
webstatus:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- HealthChecksUI__HealthChecks__0__Name=WebMVC HTTP Check
- HealthChecksUI__HealthChecks__0__Uri=http://webmvc/hc
- HealthChecksUI__HealthChecks__1__Name=WebSPA HTTP Check
- HealthChecksUI__HealthChecks__1__Uri=http://webspa/hc
- HealthChecksUI__HealthChecks__2__Name=Web Shopping Aggregator GW HTTP Check
- HealthChecksUI__HealthChecks__2__Uri=http://webshoppingagg/hc
- HealthChecksUI__HealthChecks__3__Name=Mobile Shopping Aggregator HTTP Check
- HealthChecksUI__HealthChecks__3__Uri=http://mobileshoppingagg/hc
- HealthChecksUI__HealthChecks__4__Name=Ordering HTTP Check
- HealthChecksUI__HealthChecks__4__Uri=http://ordering-api/hc
- HealthChecksUI__HealthChecks__5__Name=Basket HTTP Check
- HealthChecksUI__HealthChecks__5__Uri=http://basket-api/hc
- HealthChecksUI__HealthChecks__6__Name=Catalog HTTP Check
- HealthChecksUI__HealthChecks__6__Uri=http://catalog-api/hc
- HealthChecksUI__HealthChecks__7__Name=Identity HTTP Check
- HealthChecksUI__HealthChecks__7__Uri=http://identity-api/hc
- HealthChecksUI__HealthChecks__8__Name=Payments HTTP Check
- HealthChecksUI__HealthChecks__8__Uri=http://payment-api/hc
- HealthChecksUI__HealthChecks__9__Name=Ordering SignalRHub HTTP Check
- HealthChecksUI__HealthChecks__9__Uri=http://ordering-signalrhub/hc
- HealthChecksUI__HealthChecks__10__Name=Ordering HTTP Background Check
- HealthChecksUI__HealthChecks__10__Uri=http://ordering-backgroundtasks/hc
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5107:80"
# webhooks-api:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - ConnectionString=${ESHOP_AZURE_WEBHOOKS_DB:-Server=sqldata;Database=Microsoft.eShopOnContainers.Services.WebhooksDb;User Id=sa;Password=Pass@word;Encrypt=False}
# - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
# - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
# - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
# - IdentityUrl=http://identity-api
# - IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
# 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
# - urls__basket=http://basket-api
# - urls__catalog=http://catalog-api
# - urls__orders=http://ordering-api
# - urls__identity=http://identity-api
# - urls__grpcBasket=http://basket-api:81
# - urls__grpcCatalog=http://catalog-api:81
# - urls__grpcOrdering=http://ordering-api:81
# - CatalogUrlHC=http://catalog-api/hc
# - OrderingUrlHC=http://ordering-api/hc
# - IdentityUrlHC=http://identity-api/hc
# - BasketUrlHC=http://basket-api/hc
# - PaymentUrlHC=http://payment-api/hc
# - IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
# ports:
# - "5120:80"
#
# webshoppingagg:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - urls__basket=http://basket-api
# - urls__catalog=http://catalog-api
# - urls__orders=http://ordering-api
# - urls__identity=http://identity-api
# - urls__grpcBasket=http://basket-api:81
# - urls__grpcCatalog=http://catalog-api:81
# - urls__grpcOrdering=http://ordering-api:81
# - CatalogUrlHC=http://catalog-api/hc
# - OrderingUrlHC=http://ordering-api/hc
# - IdentityUrlHC=http://identity-api/hc
# - BasketUrlHC=http://basket-api/hc
# - PaymentUrlHC=http://payment-api/hc
# - IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
# ports:
# - "5121:80"
#
# ordering-signalrhub:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
# - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
# - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
# - AzureServiceBusEnabled=False
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# - identityUrl=http://identity-api
# ports:
# - "5112:80"
#
# webstatus:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - HealthChecksUI__HealthChecks__0__Name=WebMVC HTTP Check
# - HealthChecksUI__HealthChecks__0__Uri=http://webmvc/hc
# - HealthChecksUI__HealthChecks__1__Name=WebSPA HTTP Check
# - HealthChecksUI__HealthChecks__1__Uri=http://webspa/hc
# - HealthChecksUI__HealthChecks__2__Name=Web Shopping Aggregator GW HTTP Check
# - HealthChecksUI__HealthChecks__2__Uri=http://webshoppingagg/hc
# - HealthChecksUI__HealthChecks__3__Name=Mobile Shopping Aggregator HTTP Check
# - HealthChecksUI__HealthChecks__3__Uri=http://mobileshoppingagg/hc
# - HealthChecksUI__HealthChecks__4__Name=Ordering HTTP Check
# - HealthChecksUI__HealthChecks__4__Uri=http://ordering-api/hc
# - HealthChecksUI__HealthChecks__5__Name=Basket HTTP Check
# - HealthChecksUI__HealthChecks__5__Uri=http://basket-api/hc
# - HealthChecksUI__HealthChecks__6__Name=Catalog HTTP Check
# - HealthChecksUI__HealthChecks__6__Uri=http://catalog-api/hc
# - HealthChecksUI__HealthChecks__7__Name=Identity HTTP Check
# - HealthChecksUI__HealthChecks__7__Uri=http://identity-api/hc
# - HealthChecksUI__HealthChecks__8__Name=Payments HTTP Check
# - HealthChecksUI__HealthChecks__8__Uri=http://payment-api/hc
# - HealthChecksUI__HealthChecks__9__Name=Ordering SignalRHub HTTP Check
# - HealthChecksUI__HealthChecks__9__Uri=http://ordering-signalrhub/hc
# - HealthChecksUI__HealthChecks__10__Name=Ordering HTTP Background Check
# - HealthChecksUI__HealthChecks__10__Uri=http://ordering-backgroundtasks/hc
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# ports:
# - "5107:80"
#
# webspa:
# environment:
# - ASPNETCORE_ENVIRONMENT=Production
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
# - PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
# - IdentityUrlHC=http://identity-api/hc
# - UseCustomizationData=True
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# - SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
# ports:
# - "5104:80"
#
# webmvc:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - PurchaseUrl=http://webshoppingapigw
# - IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
# - SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
# - IdentityUrlHC=http://identity-api/hc
# - UseCustomizationData=True
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# - UseLoadTest=${USE_LOADTEST:-False}
# ports:
# - "5100:80"
#
# webhooks-client:
# environment:
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - Token=6168DB8D-DC58-4094-AF24-483278923590 # Webhooks are registered with this token (any value is valid) but the client won't check it
# - IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
# - CallBackUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5114
# - WebhooksUrl=http://webhooks-api
# - SelfUrl=http://webhooks-client/
# ports:
# - "5114:80"
webspa:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://0.0.0.0:80
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- IdentityUrlHC=http://identity-api/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
ports:
- "5104:80"
webmvc:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- PurchaseUrl=http://webshoppingapigw
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- IdentityUrlHC=http://identity-api/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5100:80"
webhooks-client:
environment:
- ASPNETCORE_URLS=http://0.0.0.0:80
- Token=6168DB8D-DC58-4094-AF24-483278923590 # Webhooks are registered with this token (any value is valid) but the client won't check it
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- CallBackUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5114
- WebhooksUrl=http://webhooks-api
- SelfUrl=http://webhooks-client/
ports:
- "5114:80"
volumes:
eshop-sqldata:
external: false


+ 92
- 92
src/docker-compose.prod.yml View File

@ -107,56 +107,56 @@ services:
ports:
- "5111:80"
webspa:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
- PurchaseUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5202
- CatalogUrlHC=http://catalog-api/hc
- OrderingUrlHC=http://ordering-api/hc
- IdentityUrlHC=http://identity-api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
- BasketUrlHC=http://basket-api/hc
- PaymentUrlHC=http://payment-api/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5104:80"
webmvc:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- PurchaseUrl=http://webshoppingapigw
- 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
- IdentityUrlHC=http://identity-api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
- BasketUrlHC=http://basket-api/hc
- PaymentUrlHC=http://payment-api/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5100:80"
webstatus:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- CatalogUrl=http://catalog-api/hc
- OrderingUrl=http://ordering-api/hc
- BasketUrl=http://basket-api/hc
- IdentityUrl=http://identity-api/hc
- PaymentUrl=http://payment-api/hc
- mvc=http://webmvc/hc
- spa=http://webspa/hc
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5107:80"
# webspa:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
# - PurchaseUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5202
# - CatalogUrlHC=http://catalog-api/hc
# - OrderingUrlHC=http://ordering-api/hc
# - IdentityUrlHC=http://identity-api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
# - BasketUrlHC=http://basket-api/hc
# - PaymentUrlHC=http://payment-api/hc
# - UseCustomizationData=True
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# ports:
# - "5104:80"
#
# webmvc:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - PurchaseUrl=http://webshoppingapigw
# - 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
# - IdentityUrlHC=http://identity-api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
# - BasketUrlHC=http://basket-api/hc
# - PaymentUrlHC=http://payment-api/hc
# - UseCustomizationData=True
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# - UseLoadTest=${USE_LOADTEST:-False}
# ports:
# - "5100:80"
#
# webstatus:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - ASPNETCORE_URLS=http://0.0.0.0:80
# - CatalogUrl=http://catalog-api/hc
# - OrderingUrl=http://ordering-api/hc
# - BasketUrl=http://basket-api/hc
# - IdentityUrl=http://identity-api/hc
# - PaymentUrl=http://payment-api/hc
# - mvc=http://webmvc/hc
# - spa=http://webspa/hc
# - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
# - OrchestratorType=${ORCHESTRATOR_TYPE}
# ports:
# - "5107:80"
payment-api:
environment:
@ -191,45 +191,45 @@ 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
- urls__basket=http://basket-api
- urls__catalog=http://catalog-api
- urls__orders=http://ordering-api
- urls__identity=http://identity-api #Local: You need to open your local dev-machine firewall at range 5100-5110.
ports:
- "80" # Important: In a production environment your should remove the external port (5120) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
webshoppingagg:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- urls__basket=http://basket-api
- urls__catalog=http://catalog-api
- urls__orders=http://ordering-api
- urls__identity=http://identity-api #Local: You need to open your local dev-machine firewall at range 5100-5110.
ports:
- "80" # Important: In a production environment your should remove the external port (5121) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
# 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
# - urls__basket=http://basket-api
# - urls__catalog=http://catalog-api
# - urls__orders=http://ordering-api
# - urls__identity=http://identity-api #Local: You need to open your local dev-machine firewall at range 5100-5110.
# ports:
# - "80" # Important: In a production environment your should remove the external port (5120) kept here for microservice debugging purposes.
# # The API Gateway redirects and access through the internal port (80).
#
# webshoppingagg:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - urls__basket=http://basket-api
# - urls__catalog=http://catalog-api
# - urls__orders=http://ordering-api
# - urls__identity=http://identity-api #Local: You need to open your local dev-machine firewall at range 5100-5110.
# ports:
# - "80" # Important: In a production environment your should remove the external port (5121) kept here for microservice debugging purposes.
# # The API Gateway redirects and access through the internal port (80).
#

+ 1
- 1
src/docker-compose.windows.yml View File

@ -6,7 +6,7 @@ version: '3.4'
services:
sqldata:
image: mcr.microsoft.com/mssql/server:2019-latest
image: mcr.microsoft.com/azure-sql-edge:latest
nosqldata:
image: mongo:windowsservercore


+ 91
- 91
src/docker-compose.yml View File

@ -6,8 +6,8 @@ services:
image: datalust/seq:latest
sqldata:
image: mcr.microsoft.com/mssql/server:2019-latest
image: mcr.microsoft.com/azure-sql-edge:latest
nosqldata:
image: mongo
@ -70,92 +70,92 @@ services:
depends_on:
- rabbitmq
webhooks-api:
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}
build:
context: .
dockerfile: ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
depends_on:
- nosqldata
- sqldata
- identity-api
- rabbitmq
- ordering-api
- catalog-api
- basket-api
webshoppingagg:
image: ${REGISTRY:-eshop}/webshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
depends_on:
- nosqldata
- sqldata
- identity-api
- rabbitmq
- ordering-api
- catalog-api
- basket-api
ordering-signalrhub:
image: ${REGISTRY:-eshop}/ordering.signalrhub:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: Services/Ordering/Ordering.SignalrHub/Dockerfile
depends_on:
- nosqldata
- sqldata
- identity-api
- rabbitmq
- ordering-api
- catalog-api
- basket-api
webstatus:
image: ${REGISTRY:-eshop}/webstatus:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: Web/WebStatus/Dockerfile
webspa:
image: ${REGISTRY:-eshop}/webspa:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: Web/WebSPA/Dockerfile
args:
NODE_IMAGE: ${NODE_IMAGE:-node:12.0}
depends_on:
- webshoppingagg
- webshoppingapigw
webmvc:
image: ${REGISTRY:-eshop}/webmvc:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: Web/WebMVC/Dockerfile
depends_on:
- webshoppingagg
- webshoppingapigw
webhooks-client:
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
# webhooks-api:
# 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.16.0
#
# mobileshoppingagg:
# image: ${REGISTRY:-eshop}/mobileshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
# depends_on:
# - nosqldata
# - sqldata
# - identity-api
# - rabbitmq
# - ordering-api
# - catalog-api
# - basket-api
#
# webshoppingagg:
# image: ${REGISTRY:-eshop}/webshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
# depends_on:
# - nosqldata
# - sqldata
# - identity-api
# - rabbitmq
# - ordering-api
# - catalog-api
# - basket-api
#
# ordering-signalrhub:
# image: ${REGISTRY:-eshop}/ordering.signalrhub:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: Services/Ordering/Ordering.SignalrHub/Dockerfile
# depends_on:
# - nosqldata
# - sqldata
# - identity-api
# - rabbitmq
# - ordering-api
# - catalog-api
# - basket-api
#
# webstatus:
# image: ${REGISTRY:-eshop}/webstatus:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: Web/WebStatus/Dockerfile
#
# webspa:
# image: ${REGISTRY:-eshop}/webspa:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: Web/WebSPA/Dockerfile
# args:
# NODE_IMAGE: ${NODE_IMAGE:-node:12.0}
# depends_on:
# - webshoppingagg
# - webshoppingapigw
#
# webmvc:
# image: ${REGISTRY:-eshop}/webmvc:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: Web/WebMVC/Dockerfile
# depends_on:
# - webshoppingagg
# - webshoppingapigw
#
# webhooks-client:
# image: ${REGISTRY:-eshop}/webhooks.client:${PLATFORM:-linux}-${TAG:-latest}
# build:
# context: .
# dockerfile: Web/WebhookClient/Dockerfile
# depends_on:
# - webhooks-api
#
# webshoppingapigw:
# image: envoyproxy/envoy:v1.16.0

Loading…
Cancel
Save