dependencies
(OPTIONAL)
This key is containing an array of dependency objects, which are used to define dependencies between apps (containers). Dependencies make sure that the apps are started in the appropriate order.
version: "v1"
project: "wordpress"
services:
frontend:
apache:
image: "wordpress:4.8.3"
env:
- WORDPRESS_DB_HOST: "mysql.backend.wordpress"
dependencies:
- "../backend/mysql"
backend:
mysql:
image: "mysql:5.7.20"
For a full example, check our WordPress quickstarter.
When using a docker-compose.yml depends_on
is mapped to dependencies
.