{"action":"reopened","issue":{"url":"https://api.github.com/repos/docker/compose/issues/1988","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/1988/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/1988/comments","events_url":"https://api.github.com/repos/docker/compose/issues/1988/events","html_url":"https://github.com/docker/compose/issues/1988","id":104991727,"number":1988,"title":"Extend a base service from the same file","user":{"login":"bfirsh","id":40906,"avatar_url":"https://avatars.githubusercontent.com/u/40906?v=3","gravatar_id":"","url":"https://api.github.com/users/bfirsh","html_url":"https://github.com/bfirsh","followers_url":"https://api.github.com/users/bfirsh/followers","following_url":"https://api.github.com/users/bfirsh/following{/other_user}","gists_url":"https://api.github.com/users/bfirsh/gists{/gist_id}","starred_url":"https://api.github.com/users/bfirsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfirsh/subscriptions","organizations_url":"https://api.github.com/users/bfirsh/orgs","repos_url":"https://api.github.com/users/bfirsh/repos","events_url":"https://api.github.com/users/bfirsh/events{/privacy}","received_events_url":"https://api.github.com/users/bfirsh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/area/config","name":"area/config","color":"c7def8"},{"url":"https://api.github.com/repos/docker/compose/labels/kind/enhancement","name":"kind/enhancement","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-09-05T00:32:31Z","updated_at":"2016-03-17T21:21:52Z","closed_at":null,"body":"It is a common pattern to define a base service which you want several services to extend, but it's currently very verbose to do this:\r\n\r\n_docker-compose-base.yml_\r\n```\r\nbase:\r\n  environment:\r\n    FOO: bar\r\n```\r\n\r\n_docker-compose.yml_\r\n```\r\nweb:\r\n  extends:\r\n    file: docker-compose-base.yml\r\n    service: base\r\n  ...\r\ndb:\r\n  extends:\r\n    file: docker-compose-base.yml\r\n    service: base\r\n  ...\r\n```\r\n\r\nIt should be possible to extend an incomplete service in a single compose file. Something like this:\r\n\r\n```\r\nbase:\r\n  abstract: true\r\n  environment:\r\n    FOO: bar\r\nweb:\r\n  extends:\r\n    service: base\r\n  ...\r\ndb:\r\n  extends:\r\n    service: base\r\n```\r\n\r\nDesign decisions:\r\n\r\n - How should a service be marked as a service that shouldn't be run? (I've used \"abstract\" in the example above for the sake of illustration, pinched from Django's \"abstract\" models.)"}}