Inheritance or nesting with docker compose

With docker-compose 1.6 this should be possible.

Create a docker-compose.yml with your common services:

service01:
  image: image01
  links:
    - service02

service02:
  image: image02

And a second file, docker-compose.prod.yml with your unique services:

service03:
  image: image03
  links:
    - service02

Now you can start service 01, 02 and 03 with this command:

docker-compose -f docker-compose.yml -f docker-compose.prod.yml

For more information, see the official documentation:
https://docs.docker.com/compose/extends/#multiple-compose-files

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)