Mails microservice container

The microservice that sends emails to users builds on the image from the Dockerfile stored in the ./microservices/mails folder. This microservice depends on the smtp container, but this microservice doesn't check that the mail service is ready for work. If you want to check that the mail server is ready, add a piece of code that will try to connect to the SMTP server before starting any activity. Look at the following settings:

mails:
build: ./microservices/mails
depends_on:
- smtp
environment:
- RUST_LOG=mails_microservice=debug
- RUST_BACKTRACE=1
- MAILS_ADDRESS=0.0.0.0:8000
- MAILS_SMTP_ADDRESS=smtp:2525
- [email protected]
- MAILS_SMTP_PASSWORD=password
ports:
- 8002:8000

We also configure a microservice with environment variables and forward port 8002 to port 8000 of the container. You  can use port 8002 to check that the microservice started and works.

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

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