You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I'm here to tell you the ocelot.json configuration is wrong by this Docker and docker-compose files.
Your host and Ports are using the Docker internal network but I didn't see your config write this network bridge.
we've 2 ways to solve this problem:
First:
change all Host and Ports that you've written in the Ocelot ReRoutes configuration to this config so don't need network-bridge anymore:
Host: "host.docker.internal"
Port: "the exposed port in docker-compose file"
I think this will work right.
the final Sample ocelot.json file after I have just changed Host and Ports
"DownstreamPathTemplate": "/api/v1/Discount/{productName}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "host.docker.internal", "Port": 5003 //this port have exposed in docker-compose.override.yml file }
Second:
create a network bridge in docker-compose and then use that network for all containers.
In this way, ocelot will use Internal docker network that knows the Host and Ports.
Done.
the final Sample ocelot.json file after I have created the network-bridge
"DownstreamPathTemplate": "/api/v1/Discount/{productName}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "discount_api", // My container_name "Port": 80 //this port have exposed in DockerFile }
if you have any questions let's be easy and ask.
The text was updated successfully, but these errors were encountered:
Hello. I'm here to tell you the ocelot.json configuration is wrong by this Docker and docker-compose files.
Your host and Ports are using the Docker internal network but I didn't see your config write this network bridge.
we've 2 ways to solve this problem:
First:
Host: "host.docker.internal"
Port: "the exposed port in docker-compose file"
I think this will work right.
the final Sample ocelot.json file after I have just changed Host and Ports
"DownstreamPathTemplate": "/api/v1/Discount/{productName}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "host.docker.internal", "Port": 5003 //this port have exposed in docker-compose.override.yml file }
Second:
In this way, ocelot will use Internal docker network that knows the Host and Ports.
Done.
the final Sample ocelot.json file after I have created the network-bridge
"DownstreamPathTemplate": "/api/v1/Discount/{productName}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "discount_api", // My container_name "Port": 80 //this port have exposed in DockerFile }
if you have any questions let's be easy and ask.
The text was updated successfully, but these errors were encountered: