Hacker News new | ask | show | jobs
by whalesalad 996 days ago
> 2507 line docker-compose file

mother_of_god.gif

1 comments

Yeah, she's a big girl, but having one flat file and one systemd process is infinitely better than juggling 85 of each. I have the systemd process start after docker.service, and most of my containers have a "depends_on" argument so they don't all try to boot at once. All of the containers also push logging to a Splunk instance, which adds 9 lines per container, which increases the file by 765 lines.
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!
you had me until you said splunk and now I am horrified to know the true topology of your homelab
Heh, Splunk is way overkill for what I need, but they have a free 10GB Dev license that you have to renew every 6 months, and building a custom COVID dashboard during the first few months of 2020 kept me sane. Here's my home/lab "prod":

Homeserver: Ryzen 3950x, 64GB RAM, Ubuntu 22.04 DNS: 1 RPi 3B+ and 1 RPi 400 running pihole and Unbound Edge router/firewall: Palo Alto PA-440 Switch: Cisco 2960 24-port w/PoE AP: Aruba AP-345 in Instant mode

Have you used splunk's free tier? It's easy to setup, 500mb/day ingest free, and it's pretty easy to use (easier than grafana imho.) If they're using it professionally then why not at home?