cage icon indicating copy to clipboard operation
cage copied to clipboard

depends_on with health checks (requires compose.yml v3)

Open aduzsardi opened this issue 5 years ago • 6 comments

Hi, Can you have dependencies between services in a pod ? like serviceA should start before serviceB where both services are in the same yaml file

aduzsardi avatar Jul 08 '20 09:07 aduzsardi

Yes, within a pod you can use depends_on normally.

emk avatar Jul 08 '20 11:07 emk

Thank you , i forgot i can use only v2 compose directives so no heath check conditions in depends_on

    depends_on:
      api:
        condition: service_healthy

aduzsardi avatar Jul 08 '20 13:07 aduzsardi

Ah, yes, that would be a nice thing to support. Is it v3 only?

emk avatar Jul 27 '20 11:07 emk

Yes , it's v3 only

aduzsardi avatar Jul 27 '20 11:07 aduzsardi

Right now, we support multiple versions of v2, but we don't really have any APIs for supporting v3, and I'm not even sure how I should handle v2 and v3 support. Migrate everything to v3 internally when we load it, maybe? Hmm.

emk avatar Jul 27 '20 11:07 emk

I don't know why i was under the impression that it's only in v3 , seems like i was mistaken https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on

aduzsardi avatar Jul 27 '20 13:07 aduzsardi