Ramblings of an aging IT geek
← Ramblings of an aging IT geek
homelab

one compose file to run the entire house

How I consolidated a sprawl of hand-started containers into a single docker-compose stack that survives a reboot and that I can actually reason about.

A server rack with cabling

For about a year my home server was held together by my own memory. A pile of docker run commands I'd typed once, half of them in a notes file, half of them only in the shell history of a box I was scared to reboot. When something fell over I had to reverse-engineer what flags I'd used the first time. That's not a system, that's a hostage situation.

So over a quiet weekend I sat down and moved the lot into a single docker-compose.yml. Not glamorous, but it's the best thing I've done to the homelab all year.

Why one file

The win isn't Compose itself, it's having the whole house described in one place I can read top to bottom. Pi-hole, a reverse proxy, Home Assistant, a couple of media bits, the database they all lean on. When I want to know what's running, I open one file. When I rebuild the box, I run one command. When something behaves oddly, I have a single source of truth to argue with instead of my own recollection.

A homelab shelf of equipment and cabling

The shape of it

Nothing clever here, and that's the point. The structure that's served me well:

version: "3.7"

services:
  traefik:
    image: traefik:v1.7
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik:/etc/traefik

  pihole:
    image: pihole/pihole:latest
    restart: unless-stopped
    environment:
      - TZ=Europe/London
    volumes:
      - ./pihole/etc:/etc/pihole
      - ./pihole/dnsmasq:/etc/dnsmasq.d

  homeassistant:
    image: homeassistant/home-assistant:latest
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./homeassistant:/config

A few things I learned the hard way. Pin restart: unless-stopped on everything, or a reboot leaves you with a quiet house and a confused family. Keep every bind mount under the project directory so the whole stack is one folder to back up. And resist the urge to one-line clever it; future-me reads this at midnight, and future-me is not clever.

What it bought me

The real payoff came two weeks later when the SSD started throwing errors. I swapped the drive, restored the project folder from backup, ran docker-compose up -d, and the house came back in under five minutes. No archaeology, no trying to remember which port I'd mapped Pi-hole to. That's the moment the weekend paid for itself.

It's not Kubernetes and it doesn't need to be. It's a text file and a command, and for a house that's exactly the right amount of infrastructure.