Proposal: New field to define ordered start and stop
Original implementation is #686
Now that networks don't require you to define service dependencies we could provide a new field to define an order, allowing applications to start and stop containers in a specific order.
The advantage to a new field (and not re-using an existing one), is that it allows applications that don't need an order to start and stop everything in parallel. Order would only be applied explicitly if the user wants it.
This does not address healthchecking and the problems described in #374, but it's a prerequisite of any solution to that problem. It does solve issues like #2619 (and maybe others?).
Current proposal is to name the field depends_on
+1
This does solve the issue expressed in #2445 and #2614, as nginx doesn't care whether the proxy endpoint is accessible at startup as long as it can resolve the name. The missing name in /etc/hosts is the prime problem in both of those errors.
I have a Varnish, Apache, PHP-FPM, and MySQL composer stack that suffers greatly from this. A docker-compose start invariably results in PHP-FPM and MySQL being up, and Apache and Varnish being down. If I'm lucky, a second start will bring both of the other machines up.