I'm using Docker Compose to run two services. The first service, called WAHA, takes around 120 seconds to start, and I need to manually log in during that time for it to initialize its sessions. Only after this process can WAHA be considered ready. I want to make sure that the second service does not start until WAHA explicitly signals that it is ready. Any suggestions on how to achieve this?
1 Answer
You could implement a health check for the WAHA service that only returns a healthy status once it's fully logged in and initialized. Then, you can use the `depends_on` directive in your Docker Compose file to ensure the second service only starts once WAHA is healthy.

I tried coding a solution based on that idea, but it didn't work out as expected. I'm really hoping to hear from someone more experienced on this.