πŸ”„ GitOps Infrastructure

Repository: github.com/jhathcock-sys/Dockers

Project Overview

Infrastructure as Code for my homelab environment. All Docker Compose configurations are version-controlled in Git, enabling reproducible deployments, change tracking, and easy rollbacks.

This is a stepping stone toward full Kubernetes orchestration, building GitOps practices while working with Docker Compose.


πŸ“ Repository Structure

homelab-ops/
β”œβ”€β”€ proxmox/                    # ProxMoxBox (192.168.1.4) stacks
β”‚   β”œβ”€β”€ dockhand/               # Docker management UI
β”‚   β”œβ”€β”€ homepage/               # Dashboard + config files
β”‚   β”‚   └── config/             # services.yaml, widgets.yaml, etc.
β”‚   β”œβ”€β”€ homelab-tools/          # Homebox asset inventory
β”‚   β”œβ”€β”€ minecraft/              # PaperMC + Geyser/Floodgate
β”‚   β”œβ”€β”€ monitoring/             # Full observability stack
β”‚   β”‚   β”œβ”€β”€ alertmanager/       # Alert routing config (Discord)
β”‚   β”‚   β”œβ”€β”€ prometheus/         # Scrape configs + alert rules
β”‚   β”‚   β”œβ”€β”€ loki/               # Log aggregation config
β”‚   β”‚   β”œβ”€β”€ promtail/           # Log collector config
β”‚   β”‚   └── grafana/            # Dashboard provisioning
β”‚   β”œβ”€β”€ nginx-proxy-manager/    # Reverse proxy
β”‚   └── uptime-kuma/            # Service health monitoring
β”‚
└── pi5/                        # Raspberry Pi 5 stacks (via Hawser)
    β”œβ”€β”€ infra/                  # Pi-hole + Tailscale
    β”œβ”€β”€ mealie/                 # Recipe management
    └── nebula-sync/            # Pi-hole sync

πŸš€ Deployment Workflow

Local Stacks (ProxMoxBox)

# 1. Edit compose files locally
vim proxmox/homepage/docker-compose.yaml

# 2. Commit and push
git add . && git commit -m "Update homepage config"
git push

# 3. On server: pull and deploy
cd /opt/homepage
git pull
docker compose up -d

Remote Stacks (Pi5 via Hawser)

Pi5 stacks are managed remotely through Dockhand’s Hawser agent:

  • Compose files live on ProxMoxBox at /opt/pi5-stacks/
  • Hawser executes commands on the Pi5 Docker daemon
  • No SSH required for routine deployments

πŸ—ΊοΈ Path Mapping

Git PathDeploy PathServer
proxmox/<stack>//opt/<stack>/ProxMoxBox
pi5/<stack>//opt/pi5-stacks/<stack>/ProxMoxBox (Hawser β†’ Pi5)

πŸ”§ Stack Management with Dockhand

Dockhand provides a web UI for Docker management:

  • Stack Import: Adopt existing containers by pointing to compose files
  • Remote Management: Hawser agent enables control of remote Docker hosts
  • Compose Editing: Edit and redeploy stacks from the UI

Key Configuration

services:
  dockhand:
    image: fnsys/dockhand:latest
    environment:
      - HOST_DATA_DIR=/opt          # Path resolution for stacks
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt:/opt                   # Access to all compose files

πŸ” Secrets Management

Sensitive values are kept out of Git using .env files:

# Template provided in repo
cp .env.example .env

# Generate encryption keys
openssl rand -hex 32

Pattern:

  • .env.example β†’ Committed (templates with placeholders)
  • .env β†’ Gitignored (actual secrets)

πŸ“Š Current Stacks

ProxMoxBox Services

StackPortsPurpose
dockhand3000Docker management
homepage4000Dashboard
homelab-tools3100Homebox inventory
minecraft25565, 19132/udpGame server
monitoring3030, 9090, 9093, 9100, 8081, 3101Grafana, Prometheus, Alertmanager, Loki, exporters
nginx-proxy-manager80, 443, 81Reverse proxy
uptime-kuma3001Health monitoring

Pi5 Services (via Hawser)

StackServicesPurpose
infraPi-hole, TailscaleDNS + VPN
mealieMealieRecipe management
nebula-syncNebula-syncPi-hole replication
promtailPromtailLog collection to Loki


πŸ–₯️ Non-Docker Services

Some infrastructure runs on dedicated VMs outside the GitOps workflow:

ServiceIPNotes
Wazuh SIEM192.168.1.7Security monitoring - standalone Debian VM

These are managed separately but integrate with the Docker-based services (e.g., Wazuh agents on Docker hosts report to the SIEM).


πŸ“‹ Future Plans

  • Implement CI/CD pipeline for automated deployments
  • Add pre-commit hooks for YAML linting
  • Migrate to Kubernetes with ArgoCD
  • Set up Renovate for automated image updates