One option nobody mentioned: Compose has a top-level include: (Compose v2.20+). In stack 2 add
include:-../stack1/docker-compose.yml
and gluetun becomes part of the same project, so depends_on: gluetun: condition: service_healthy works again. The catch is that docker compose up/down in stack 2 now manages gluetun too, so it’s best if stack 1 is only gluetun and everything else lives in its own files.
One option nobody mentioned: Compose has a top-level
include:(Compose v2.20+). In stack 2 addinclude: - ../stack1/docker-compose.ymland gluetun becomes part of the same project, so
depends_on: gluetun: condition: service_healthyworks again. The catch is thatdocker compose up/downin stack 2 now manages gluetun too, so it’s best if stack 1 is only gluetun and everything else lives in its own files.