Content microservice container

The content microservice is built with the Dockerfile file in the ./microservices/content folder. We also created this file earlier in this chapter. Since the content microservice is based on the Rocket framework, we can use the environment variables with the ROCKET prefix to configure the microservice:

content:
build: ./microservices/content
depends_on:
- dbsync
ports:
- 8888:8000
environment:
- RUST_LOG=content_microservice=debug
- RUST_BACKTRACE=1
- ROCKET_ADDRESS=0.0.0.0
- ROCKET_PORT=8000
- ROCKET_DATABASES={postgres_database={url="postgresql://postgres:password@db:5432"}}
ports:
- 8003:8000

This microservice uses the database and depends on the dbsync container, which in turn depends on the db container with a database instance. We open port 8003 to access this microservice outside Docker.

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

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