Fix for rabbitMQ under windows containers.
Also some config tweaking on windows
This commit is contained in:
parent
4e87a5c77e
commit
6fd4f46058
2
.env
2
.env
@ -21,3 +21,5 @@ ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92
|
||||
#ESHOP_AZURE_STORAGE_CATALOG_KEY=<YourAzureStorageCatalogKey>
|
||||
#ESHOP_AZURE_STORAGE_MARKETING_NAME=<YourAzureStorageMarketingName>
|
||||
#ESHOP_AZURE_STORAGE_MARKETING_KEY=<YourAzureStorageMarketingKey>
|
||||
#ESHOP_SERVICE_BUS_USERNAME=<ServiceBusUserName-OnlyUsedIfUsingRabbitMQUnderwindows>
|
||||
#ESHOP_SERVICE_BUS_PASSWORD=<ServiceBusUserPassword-OnlyUsedIfUsingRabbitMQUnderwindows>
|
||||
|
@ -1,5 +1,10 @@
|
||||
# rootPath: Root path of the repo (where docker-compose*.yml are). If not passed ../cli-windows/ is assumed
|
||||
# buildBits: If the projects must be built before. Default value: $true
|
||||
# customEventBusLoginPassword: If a custom RabbitMQ image is used that do not use the default user login/pwd. Default: $false (means assume use default spring2/rabbitmq image)
|
||||
|
||||
Param(
|
||||
[parameter(Mandatory=$false)][string] $rootPath,
|
||||
[parameter(Mandatory=$false)][bool] $customEventBusLoginPassword=$false,
|
||||
[parameter(Mandatory=$false)][bool]$buildBits=$true
|
||||
)
|
||||
|
||||
@ -13,4 +18,15 @@ Write-Host "Root path used is $rootPath" -ForegroundColor Yellow
|
||||
if ($buildBits) {
|
||||
& $scriptPath\build-bits.ps1 -rootPath $rootPath
|
||||
}
|
||||
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" up
|
||||
|
||||
|
||||
$env:ESHOP_EXTERNAL_DNS_NAME_OR_IP = "10.0.75.1"
|
||||
$env:ESHOP_AZURE_STORAGE_CATALOG_URL ="http://10.0.75.1:5101/api/v1/catalog/items/[0]/pic/"
|
||||
$env:ESHOP_AZURE_STORAGE_MARKETING_URL ="http://10.0.75.1:5110/api/v1/campaigns/[0]/pic/"
|
||||
|
||||
if (-Not $customEventBusLoginPassword) {
|
||||
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" -f "$rootPath\docker-compose.override.windows.yml" up
|
||||
}
|
||||
else {
|
||||
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" up
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ services:
|
||||
- rabbitmq
|
||||
|
||||
marketing.api:
|
||||
image: eshop/marketing.api:${TAG:-latest}
|
||||
image: eshop/marketing.api-win:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Marketing/Marketing.API
|
||||
dockerfile: Dockerfile
|
||||
@ -73,13 +73,13 @@ services:
|
||||
- marketing.api
|
||||
|
||||
webstatus:
|
||||
image: eshop/webstatus:${TAG:-latest}
|
||||
image: eshop/webstatus-win:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Web/WebStatus
|
||||
dockerfile: Dockerfile
|
||||
|
||||
payment.api:
|
||||
image: eshop/payment.api:${TAG:-latest}
|
||||
image: eshop/payment.api-win:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Payment/Payment.API
|
||||
dockerfile: Dockerfile
|
||||
@ -87,7 +87,7 @@ services:
|
||||
- rabbitmq
|
||||
|
||||
locations.api:
|
||||
image: eshop/locations.api:${TAG:-latest}
|
||||
image: eshop/locations.api-win:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Location/Locations.API
|
||||
dockerfile: Dockerfile
|
||||
@ -103,17 +103,11 @@ services:
|
||||
|
||||
basket.data:
|
||||
image: redis:nanoserver
|
||||
# build:
|
||||
# context: ./_docker/redis
|
||||
# dockerfile: Dockerfile
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
rabbitmq:
|
||||
image: spring2/rabbitmq
|
||||
# build:
|
||||
# context: ./_docker/rabbitmq
|
||||
# dockerfile: Dockerfile
|
||||
ports:
|
||||
- "15672:15672"
|
||||
- "5672:5672"
|
||||
|
53
docker-compose.override.windows.yml
Normal file
53
docker-compose.override.windows.yml
Normal file
@ -0,0 +1,53 @@
|
||||
version: '2.1'
|
||||
|
||||
# ONLY NEEDED WHEN RUNNING WINDOWS CONTAINERS
|
||||
#
|
||||
# This file sets the containers' environment variables:
|
||||
#
|
||||
# - EventBusUerName
|
||||
# - EventBusPassword
|
||||
#
|
||||
# To the default username & password used in the spring2/rabbitmq image.
|
||||
#
|
||||
# If you are using any other rabbitmq image with any other username/pwd then you can:
|
||||
#
|
||||
# Set your shell environment variables:
|
||||
# - ESHOP_SERVICE_BUS_USERNAME
|
||||
# - ESHOP_SERVICE_BUS_PASSWORD
|
||||
#
|
||||
# With the appropiate values (note that you can use .env file also) AND DO NOT USE THIS FILE when launching windows container:
|
||||
#
|
||||
# docker-compose -f docker-compose-windows.yml -f docker-compose.override.yml up
|
||||
# INSTEAD OF
|
||||
# docker-compose -f docker-compose-windows.yml -f docker-compose.override.yml -f docker-compose.override.windows.yml up
|
||||
|
||||
services:
|
||||
basket.api:
|
||||
environment:
|
||||
- EventBusUserName=admin
|
||||
- EventBusPassword=password
|
||||
|
||||
catalog.api:
|
||||
environment:
|
||||
- EventBusUserName=admin
|
||||
- EventBusPassword=password
|
||||
|
||||
ordering.api:
|
||||
environment:
|
||||
- EventBusUserName=admin
|
||||
- EventBusPassword=password
|
||||
|
||||
marketing.api:
|
||||
environment:
|
||||
- EventBusUserName=admin
|
||||
- EventBusPassword=password
|
||||
|
||||
payment.api:
|
||||
environment:
|
||||
- EventBusUserName=admin
|
||||
- EventBusPassword=password
|
||||
|
||||
locations.api:
|
||||
environment:
|
||||
- EventBusUserName=admin
|
||||
- EventBusPassword=password
|
@ -16,6 +16,8 @@ services:
|
||||
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
- AzureServiceBusEnabled=False
|
||||
ports:
|
||||
- "5103:80"
|
||||
@ -27,6 +29,8 @@ services:
|
||||
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5101/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
- AzureStorageAccountName=${ESHOP_AZURE_STORAGE_CATALOG_NAME}
|
||||
- AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY}
|
||||
- UseCustomizationData=True
|
||||
@ -47,7 +51,7 @@ services:
|
||||
- MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110
|
||||
- BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103
|
||||
- OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102
|
||||
- UseCustomizationData=True
|
||||
- UseCustomizationData=True
|
||||
ports:
|
||||
- "5105:80"
|
||||
|
||||
@ -59,6 +63,8 @@ services:
|
||||
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
- UseCustomizationData=True
|
||||
- AzureServiceBusEnabled=False
|
||||
- GracePeriodTime=1
|
||||
@ -74,6 +80,8 @@ services:
|
||||
- MongoConnectionString=${ESHOP_AZURE_COSMOSDB:-mongodb://nosql.data}
|
||||
- MongoDatabase=MarketingDb
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- CampaignDetailFunctionUri=${ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI}
|
||||
@ -137,6 +145,8 @@ services:
|
||||
- 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
|
||||
ports:
|
||||
- "5108:80"
|
||||
@ -150,6 +160,8 @@ services:
|
||||
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
- AzureServiceBusEnabled=False
|
||||
ports:
|
||||
- "5109:80"
|
||||
|
@ -103,6 +103,15 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) {
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
|
||||
{
|
||||
factory.Password = Configuration["EventBusPassword"];
|
||||
}
|
||||
|
||||
return new DefaultRabbitMQPersistentConnection(factory, logger);
|
||||
});
|
||||
}
|
||||
|
@ -132,11 +132,22 @@
|
||||
{
|
||||
var settings = sp.GetRequiredService<IOptions<CatalogSettings>>().Value;
|
||||
var logger = sp.GetRequiredService<ILogger<DefaultRabbitMQPersistentConnection>>();
|
||||
|
||||
var factory = new ConnectionFactory()
|
||||
{
|
||||
HostName = settings.EventBusConnection
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
|
||||
{
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
|
||||
{
|
||||
factory.Password = Configuration["EventBusPassword"];
|
||||
}
|
||||
|
||||
return new DefaultRabbitMQPersistentConnection(factory, logger);
|
||||
});
|
||||
}
|
||||
|
@ -62,12 +62,22 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
|
||||
services.AddSingleton<IRabbitMQPersistentConnection>(sp =>
|
||||
{
|
||||
var logger = sp.GetRequiredService<ILogger<DefaultRabbitMQPersistentConnection>>();
|
||||
|
||||
var factory = new ConnectionFactory
|
||||
|
||||
var factory = new ConnectionFactory()
|
||||
{
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
|
||||
{
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
|
||||
{
|
||||
factory.Password = Configuration["EventBusPassword"];
|
||||
}
|
||||
|
||||
return new DefaultRabbitMQPersistentConnection(factory, logger);
|
||||
});
|
||||
}
|
||||
|
@ -106,6 +106,15 @@
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
|
||||
{
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
|
||||
{
|
||||
factory.Password = Configuration["EventBusPassword"];
|
||||
}
|
||||
return new DefaultRabbitMQPersistentConnection(factory, logger);
|
||||
});
|
||||
}
|
||||
|
@ -148,11 +148,22 @@
|
||||
{
|
||||
var logger = sp.GetRequiredService<ILogger<DefaultRabbitMQPersistentConnection>>();
|
||||
|
||||
|
||||
var factory = new ConnectionFactory()
|
||||
{
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
|
||||
{
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
|
||||
{
|
||||
factory.Password = Configuration["EventBusPassword"];
|
||||
}
|
||||
|
||||
return new DefaultRabbitMQPersistentConnection(factory, logger);
|
||||
});
|
||||
}
|
||||
|
@ -51,12 +51,21 @@ namespace Payment.API
|
||||
services.AddSingleton<IRabbitMQPersistentConnection>(sp =>
|
||||
{
|
||||
var logger = sp.GetRequiredService<ILogger<DefaultRabbitMQPersistentConnection>>();
|
||||
|
||||
var factory = new ConnectionFactory()
|
||||
{
|
||||
HostName = Configuration["EventBusConnection"]
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
|
||||
{
|
||||
factory.UserName = Configuration["EventBusUserName"];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
|
||||
{
|
||||
factory.Password = Configuration["EventBusPassword"];
|
||||
}
|
||||
|
||||
return new DefaultRabbitMQPersistentConnection(factory, logger);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user