Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...



Oh my god, why didn't I look into that, that's so much better. Thank you!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: