Browse Source

Ocelot config via volumes

pull/565/head^2
Eduard Tomàs 7 years ago
parent
commit
3b2c80e6d3
12 changed files with 225 additions and 2 deletions
  1. +12
    -0
      .gitattributes
  2. +31
    -1
      docker-compose.override.yml
  3. +19
    -1
      docker-compose.yml
  4. +15
    -0
      eShopOnContainers-ServicesAndWebApps.sln
  5. +1
    -0
      src/Apigw/configs/linux/mobilemarketingapigw/configuration.json
  6. +1
    -0
      src/Apigw/configs/linux/mobileshoppingapigw/configuration.json
  7. +1
    -0
      src/Apigw/configs/linux/webmarketingapigw/configuration.json
  8. +0
    -0
      src/Apigw/configs/linux/webshoppingapigw/configuration.json
  9. +1
    -0
      src/Apigw/configs/windows/mobilemarketingapigw/configuration.json
  10. +1
    -0
      src/Apigw/configs/windows/mobileshoppingapigw/configuration.json
  11. +1
    -0
      src/Apigw/configs/windows/webmarketingapigw/configuration.json
  12. +142
    -0
      src/Apigw/configs/windows/webshoppingapigw/configuration.json

+ 12
- 0
.gitattributes View File

@ -69,3 +69,15 @@
###############################################################################
*.pfx binary
################################################################################
# Ocelot config files are shared via volumes, so its EOL are important
################################################################################
/src/Apigw/configs/linux/mobilemarketingapigw/configuration.json text eol=lf
/src/Apigw/configs/linux/mobileshoppingapigw/configuration.json text eol=lf
/src/Apigw/configs/linux/webmarketingapigw/configuration.json text eol=lf
/src/Apigw/configs/linux/webshoppingapigw/configuration.json text eol=lf
/src/Apigw/configs/windows/mobilemarketingapigw/configuration.json text eol=crlf
/src/Apigw/configs/windows/mobileshoppingapigw/configuration.json text eol=crlf
/src/Apigw/configs/windows/webmarketingapigw/configuration.json text eol=crlf
/src/Apigw/configs/windows/webshoppingapigw/configuration.json text eol=crlf

+ 31
- 1
docker-compose.override.yml View File

@ -218,12 +218,42 @@ services:
- "15672:15672"
- "5672:5672"
apigw:
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"
volumes:
- ./src/Apigw/configs/mobileshoppingapigw:/app/configuration
mobilemarketingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
ports:
- "5201:80"
volumes:
- ./src/Apigw/configs/mobilemarketingapigw:/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"
volumes:
- ./src/Apigw/configs/webshoppingapigw:/app/configuration
webmarketingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
ports:
- "5203:80"
volumes:
- ./src/Apigw/configs/webmarketingapigw:/app/configuration
mobileshoppingagg:
environment:


+ 19
- 1
docker-compose.yml View File

@ -108,7 +108,25 @@ services:
rabbitmq:
image: rabbitmq:3-management-alpine
apigw:
mobileshoppingapigw:
image: eshop/ocelotapigw
build:
context: .
dockerfile: src/Apigw/OcelotApiGw/Dockerfile
mobilemarketingapigw:
image: eshop/ocelotapigw
build:
context: .
dockerfile: src/Apigw/OcelotApiGw/Dockerfile
webshoppingapigw:
image: eshop/ocelotapigw
build:
context: .
dockerfile: src/Apigw/OcelotApiGw/Dockerfile
webmarketingapigw:
image: eshop/ocelotapigw
build:
context: .


+ 15
- 0
eShopOnContainers-ServicesAndWebApps.sln View File

@ -105,6 +105,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aggregators", "Aggregators"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mobile.Shopping.HttpAggregator", "src\Aggregators\Mobile.Shopping.HttpAggregator\Mobile.Shopping.HttpAggregator.csproj", "{6E99F232-1536-424F-A28C-91692C8FD325}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "configs", "configs", "{D8D24753-8421-40EE-8FE5-B8BE06A07AC5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MobileBff.Shopping.ApiGw", "MobileBff.Shopping.ApiGw", "{DAEA3807-1578-4B43-9033-E400FAF1DC49}"
ProjectSection(SolutionItems) = preProject
src\Apigw\configs\mobileshoppingapigw\configuration.json = src\Apigw\configs\mobileshoppingapigw\configuration.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MobileBff.Marketing.ApiGw", "MobileBff.Marketing.ApiGw", "{AC3EDABD-8EB0-4045-BC12-39865490A79D}"
ProjectSection(SolutionItems) = preProject
src\Apigw\configs\mobilemarketingapigw\configuration.json = src\Apigw\configs\mobilemarketingapigw\configuration.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@ -1465,6 +1477,9 @@ Global
{E0C5162E-DF26-4341-9E51-14AE800D7505} = {7A58AA20-67F3-48F3-88C8-24EBFE621792}
{EA378316-9D49-4A6B-858E-D4A25F948A74} = {932D8224-11F6-4D07-B109-DA28AD288A63}
{6E99F232-1536-424F-A28C-91692C8FD325} = {EA378316-9D49-4A6B-858E-D4A25F948A74}
{D8D24753-8421-40EE-8FE5-B8BE06A07AC5} = {7A58AA20-67F3-48F3-88C8-24EBFE621792}
{DAEA3807-1578-4B43-9033-E400FAF1DC49} = {D8D24753-8421-40EE-8FE5-B8BE06A07AC5}
{AC3EDABD-8EB0-4045-BC12-39865490A79D} = {D8D24753-8421-40EE-8FE5-B8BE06A07AC5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}


+ 1
- 0
src/Apigw/configs/linux/mobilemarketingapigw/configuration.json View File

@ -0,0 +1 @@
{}

+ 1
- 0
src/Apigw/configs/linux/mobileshoppingapigw/configuration.json View File

@ -0,0 +1 @@
{}

+ 1
- 0
src/Apigw/configs/linux/webmarketingapigw/configuration.json View File

@ -0,0 +1 @@
{}

src/Apigw/OcelotApiGw/configuration/configuration.json → src/Apigw/configs/linux/webshoppingapigw/configuration.json View File


+ 1
- 0
src/Apigw/configs/windows/mobilemarketingapigw/configuration.json View File

@ -0,0 +1 @@
{}

+ 1
- 0
src/Apigw/configs/windows/mobileshoppingapigw/configuration.json View File

@ -0,0 +1 @@
{}

+ 1
- 0
src/Apigw/configs/windows/webmarketingapigw/configuration.json View File

@ -0,0 +1 @@
{}

+ 142
- 0
src/Apigw/configs/windows/webshoppingapigw/configuration.json View File

@ -0,0 +1,142 @@
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/shopping/api/{version}/c/{everything}",
"UpstreamHttpMethod": [ "GET" ]
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/shopping/api/{version}/b/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/shopping/api/{version}/o/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "mobileshoppingagg",
"Port": 80
}
],
"UpstreamPathTemplate": "/shopping/{everything}",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/orders-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/basket-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/catalog-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "marketing.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/marketing-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "payment.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/payment-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "locations.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/location-api/{everything}",
"UpstreamHttpMethod": []
}
],
"GlobalConfiguration": {
"RequestIdKey": "OcRequestId",
"AdministrationPath": "/administration"
}
}

Loading…
Cancel
Save