8 thoughts on “How to reduce docker-compose files”

  1. This is really cool. Didn’t know about it even though i’m using docker-compose for a while already. Thanks for sharing!

    Reply
  2. Great share, thanks!

    I was using the template syntax but I was not aware of the x- prefix! always ended up with unneeded extra template services

    Reply
  3. That’s pretty awesome.

    I have another trick that may be handy for some people. I use Docker to do a bunch of media and home automation stuff and wanted to keep the docker-compose files organized but still easy to start up in one command, so I made this BASH file:
    `#!/bin/bash`

    `docker-compose \`

    `-f base.yaml \`

    `-f productivity.yaml \`

    `-f home-automation.yaml \`

    `-f pirates.yaml \`

    `up -d –remove-orphans`

    Reply
  4. This is awesome! I’m looking forward to putting all those repeated Traefik https labels into the x-defaults.

    Reply

Leave a Comment