Router microservice container

The last service we'll configure before we start the whole application is the router microservice. This service depends on the users and content microservices, because router proxies request these microservices:

router:
build: ./microservices/router
depends_on:
- users
- content
environment:
- RUST_LOG=router_microservice=debug
- RUST_BACKTRACE=1
- ROUTER_ADDRESS=0.0.0.0:8000
- ROUTER_USERS=http://users:8000
- ROUTER_CONTENT=http://content:8000
ports:
- 8000:8000

We also configured logging with the debug level for the router_microservice namespace, turned on backtrace printing, set the socket address to bind this microservice to, and set paths to the users and content microservices with environment variables supported by the configuration. We used container names as host names, since Docker Compose configures containers to reach each other by name. We also forwarded port 8000 to the same system port. Now we can start the application with all of the containers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.254.151