Docker Compose service model is invalid because profiles break depends_on
service model is invalid regarding the depends_on constraint
Docker Compose found that enabled service profiles make the dependency model invalid, so a service depends on another service that is not part of the active model.
service model is invalid regarding the depends_on constraintcompose
Observed message
service model is invalid regarding the depends_on constraint
Why it happens
A service depends on another service that is excluded by the currently active profiles.
Compose profiles split required services across incompatible profile sets.
A service graph that is valid in one profile combination is invalid in another.
How to fix it
Ensure services that depend on each other can be active together under the same profile set.
Adjust the profiles so required dependencies are not excluded from the active model.
Test docker compose config with the intended profile combinations before running the stack.