Docker stack: Apache service will not start
First of all, depends_on
option doesn't work in swarm mode
of version 3
.(refer this issue)
In short...
depends_on is a no-op when used with docker stack deploy. Swarm mode services are restarted when they fail, so there's no reason to delay their startup. Even if they fail a few times, they will eventually recover.
Of course, even though depends_on
doesn't work, p71
should work properly since it would restart after the failure.
Thus, I think there is some error while running p71
service. that would be why the service keeps restarting. however, I am not sure what is happening inside the service only with the information you offer.
You could check the trace by checking log.
$ docker service logs -f webstack_p71
and error message
$ docker service ps --no-trunc webstack_p71 # check ERROR column