compose icon indicating copy to clipboard operation
compose copied to clipboard

Proposal: New field to define ordered start and stop

Open dnephin opened this issue 10 years ago • 3 comments

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

dnephin avatar Jan 17 '16 18:01 dnephin

+1

waterscar avatar Jan 18 '16 02:01 waterscar

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.

greylurk avatar Jan 18 '16 12:01 greylurk

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.

runeasgar avatar Jan 19 '16 02:01 runeasgar