[https://blog.nicco.io/2019/05/06/reduce-docker-compose-files-with-yaml-magic/](https://blog.nicco.io/2019/05/06/reduce-docker-compose-files-with-yaml-magic/)
Helped me a ton. Maybe you can profit from it too 🙂
Answers to your questions
[https://blog.nicco.io/2019/05/06/reduce-docker-compose-files-with-yaml-magic/](https://blog.nicco.io/2019/05/06/reduce-docker-compose-files-with-yaml-magic/)
Helped me a ton. Maybe you can profit from it too 🙂
This is really cool. Didn’t know about it even though i’m using docker-compose for a while already. Thanks for sharing!
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
I did this for logging formatting, never thought about the rest of the repeated stuff. Thanks!
Wow..! Amazing! Thanks!
Can you have more than one set of x-defaults – assuming &defaults can be set arbitrary value?
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`
This is awesome! I’m looking forward to putting all those repeated Traefik https labels into the x-defaults.
the rise of yaml programming! hahah cool trick thanks