Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • How does this work when it comes time to do docker-compose down? Wouldn't it bring down all the containers which have been brought up in all .yml files? Commented Sep 15, 2017 at 10:17
  • 2
    You can do docker-compose -f docker-compose-production.yml down
    – icarito
    Commented Sep 17, 2017 at 18:20
  • 9
    And where do you specify the container you would like to get up/down? -f is the selector of compose file, not container. Commented Dec 11, 2019 at 12:02
  • 1
    ... "by having a separate .yml file." Yes, it's not an ideal solution but it deletes not only volumes but also a network, which "docker-compose rm -s -v yourService" won't do, according to what I understand. Commented Oct 21, 2021 at 12:49