4 ms·
I’ve got a similar probably-too-large docker-compose on my home server. If those 9 lines are identical you can probably simplify quite a bit with extension fie
by snailmailman 3y ago
I’ve got a similar probably-too-large docker-compose on my home server.
If those 9 lines are identical you can probably simplify quite a bit with extension fields and yaml anchors. [0]
You would put
logging: *default-logging
As a single line under each container, and then define it elsewhere. The example on the docs page is for logging, but you can also simplify other fields too, like “depends on”.
[0] https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields https://docs.docker.com/compose/compose-file/compose-file-v3...
- seizethegdgap 3y agoOh my god, why didn't I look into that, that's so much better. Thank you!