I have a local.yml file in which I have defined 3 services: service3 depends on service2, service2 depends on service1. I want to enforce a starting order between them: service1 starts firs, then service2, then service3. What is very important for me is that service3 is the last one to start.
What I tried to do is adding the following piece of code inside service3:
services:
service3:
healthcheck:
test: curl http://localhost:8080/someUrl || exit 1
interval: 10s
build:
context: ./myDir
dockerfile: ./dockerfile3
depends_on:
- service2
service2:
build:
context: .
dockerfile: /dockerfile2
depends_on:
- service1
service1:
image: service1_image
However http://localhost:8080/someUrl is available before serivce2 finishes its starting. What I see right now in the logs (as starting order) is the following:
service1 |.......
service1 |.......
service2 |.......
service2 |.......
service3 |....... //starts after the url is available
service3 |....... //prints that service3 is available
service2 |....... //and then service2 continues to build
service2 |.......
service2 |.......
How do I display the log messages from service3 at the end? I.e. how do I start service3 in the last order?