Skip to content

Commit 6889864

Browse files
RawSalmon69claude
andcommitted
revert: drop GitOps split, single compose.yaml manual deploy
Komodo periphery path-mismatch with host docker daemon caused stale mount issues. For a single-host homelab, GitOps is overkill. - merge infra-compose.yaml + compose.yaml back into single compose.yaml - restore name: homelab - Komodo stays as observability UI only (no auto-deploy) - deploy via SSH: cd /opt/homelab && docker compose up -d Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4ed7f3c commit 6889864

3 files changed

Lines changed: 150 additions & 170 deletions

File tree

homelab/README.md

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,60 @@
11
# homelab
22

3-
Stack on `raws-homelab` (Ubuntu 22.04, Docker).
3+
Stack on `raws-homelab` (Ubuntu 22.04, Docker). Single `compose.yaml`. Manual deploy via SSH.
44

5-
## Two-File Layout
6-
7-
- `infra-compose.yaml`**manual deploy only** (Caddy, Cloudflared, AdGuard, Beszel, Komodo + Mongo + Periphery). Critical foundation; never auto-touched.
8-
- `compose.yaml`**Komodo-managed via GitOps**. Push to git → Komodo auto-deploys changed services. Apps: Glance, Vaultwarden, Dozzle, YOURLS, ExcaliDash.
9-
10-
## Manual Infra Deploy
5+
## Deploy
116

127
```bash
138
ssh root@100.106.13.67
149
cd /opt/homelab
15-
docker compose -f infra-compose.yaml up -d
10+
docker compose up -d
1611
```
1712

18-
## App Deploy (GitOps)
19-
20-
Edit on Mac → `git push` → Komodo deploys. No SSH needed.
13+
Or one-line from Mac after pushing config:
2114

22-
## Stack
23-
24-
| Service | Port | Purpose |
25-
|---------|------|---------|
26-
| AdGuard Home | 3000 (UI), 53 (DNS) | Network-wide DNS ad-block |
27-
| Beszel | 8090 | Lightweight server monitoring |
28-
| Glance | 8888 | Personal dashboard |
29-
| Cloudflared || Cloudflare tunnel for public exposure |
15+
```bash
16+
ssh root@100.106.13.67 "cd /opt/homelab && docker compose up -d"
17+
```
3018

31-
Box: `192.168.1.100` (LAN) / `100.106.13.67` (Tailscale)
19+
## Services
3220

33-
## Layout
21+
| Service | URL |
22+
|---------|-----|
23+
| Glance dashboard | https://glance.phanthawas.dev |
24+
| AdGuard Home | https://adguard.phanthawas.dev |
25+
| Beszel | https://beszel.phanthawas.dev |
26+
| Vaultwarden | https://vault.phanthawas.dev |
27+
| Dozzle (Cloudflare Access) | https://logs.phanthawas.dev |
28+
| Komodo (UI only) | https://komodo.phanthawas.dev |
29+
| YOURLS | https://yo.phanthawas.dev/admin/ |
30+
| ExcaliDash | https://draw.phanthawas.dev |
3431

35-
```
36-
homelab/
37-
├── compose.yaml ← single source of truth
38-
├── .env ← secrets (gitignored)
39-
├── adguard/{work,conf}/ ← AdGuard state
40-
├── beszel/data/ ← Beszel hub DB
41-
├── glance/glance.yml ← Glance config
42-
└── cloudflared/ ← (token in .env)
43-
```
32+
## Config Sync to Box
4433

45-
## Bring-up
34+
When editing `homelab/` files locally, sync via:
4635

4736
```bash
48-
cd /opt/homelab
49-
cp .env.example .env # fill CLOUDFLARED_TOKEN
50-
docker compose up -d # core 3 services
51-
docker compose --profile tunnel up -d # add cloudflared
52-
docker compose --profile agent up -d # add beszel-agent (needs BESZEL_KEY)
53-
```
37+
rsync -av --inplace --exclude='.env' --exclude='cloudflared/credentials.json' \
38+
--exclude='*/data/' --exclude='*/work/' --exclude='*/conf/' --exclude='*/db/' \
39+
--exclude='komodo/' \
40+
./homelab/ root@100.106.13.67:/opt/homelab/
5441

55-
## First-run checklist
56-
57-
1. **AdGuard**http://192.168.1.100:3000 → install wizard → set admin pw, upstream DNS (1.1.1.1), enable.
58-
2. **Beszel**http://192.168.1.100:8090 → create admin account → "Add system" → copy public key into `.env` as `BESZEL_KEY``docker compose --profile agent up -d`.
59-
3. **Glance**http://192.168.1.100:8888 → already wired to monitor others.
60-
4. **Cloudflared** → create tunnel in Cloudflare dashboard → paste token into `.env``docker compose --profile tunnel up -d`.
42+
ssh root@100.106.13.67 "cd /opt/homelab && docker compose up -d"
43+
```
6144

62-
## Sync from repo to box
45+
## Layout
6346

64-
```bash
65-
rsync -av --exclude='.env' --exclude='*/work/' --exclude='*/data/' \
66-
./homelab/ root@192.168.1.100:/opt/homelab/
47+
```
48+
homelab/
49+
├── compose.yaml ← single source of truth
50+
├── .env ← secrets (gitignored)
51+
├── caddy/Caddyfile ← reverse proxy routes
52+
├── cloudflared/
53+
│ ├── config.yaml ← tunnel ingress
54+
│ └── credentials.json ← gitignored
55+
├── glance/
56+
│ ├── glance.yml ← dashboard config
57+
│ └── custom.css ← (unused, kept for future)
58+
├── dozzle/data/users.yml ← bcrypt'd creds
59+
└── <service>/data ← per-service runtime data (gitignored)
6760
```

homelab/compose.yaml

Lines changed: 110 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,74 @@
1-
name: apps
1+
name: homelab
22

33
# ───────────────────────────────────────────────────────────
4-
# USER-FACING APPS — Komodo-managed via GitOps
4+
# Single source of truth for the homelab box.
5+
# Deploy on box (manual via SSH):
6+
# cd /opt/homelab && docker compose up -d
57
#
6-
# Edit on Mac → git push → Komodo auto-deploys.
7-
# Only services with config drift get recreated; rest stay up.
8-
#
9-
# Infra (Caddy, Cloudflared, AdGuard, Beszel, Komodo itself)
10-
# lives in infra-compose.yaml — manual deploy only.
8+
# Komodo runs as observability UI only — no GitOps deploys.
119
# ───────────────────────────────────────────────────────────
1210

1311
services:
12+
caddy:
13+
image: caddy:2-alpine
14+
container_name: caddy
15+
network_mode: host
16+
volumes:
17+
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
18+
- ./caddy/data:/data
19+
- ./caddy/config:/config
20+
restart: unless-stopped
21+
22+
cloudflared:
23+
image: cloudflare/cloudflared:latest
24+
container_name: cloudflared
25+
network_mode: host
26+
command: tunnel --config /etc/cloudflared/config.yaml run
27+
volumes:
28+
- ./cloudflared/config.yaml:/etc/cloudflared/config.yaml:ro
29+
- ./cloudflared/credentials.json:/etc/cloudflared/credentials.json:ro
30+
restart: unless-stopped
31+
32+
adguard:
33+
image: adguard/adguardhome:latest
34+
container_name: adguard
35+
network_mode: host
36+
volumes:
37+
- ./adguard/work:/opt/adguardhome/work
38+
- ./adguard/conf:/opt/adguardhome/conf
39+
restart: unless-stopped
40+
41+
beszel:
42+
image: henrygd/beszel:latest
43+
container_name: beszel
44+
ports:
45+
- "8090:8090"
46+
extra_hosts:
47+
- "host.docker.internal:host-gateway"
48+
volumes:
49+
- ./beszel/data:/beszel_data
50+
restart: unless-stopped
51+
52+
beszel-agent:
53+
image: henrygd/beszel-agent:latest
54+
container_name: beszel-agent
55+
network_mode: host
56+
restart: unless-stopped
57+
privileged: true
58+
environment:
59+
LISTEN: 45876
60+
KEY: ${BESZEL_KEY}
61+
TOKEN: ${BESZEL_TOKEN:-}
62+
HUB_URL: ${BESZEL_HUB_URL:-http://localhost:8090}
63+
volumes:
64+
- ./beszel/agent_data:/var/lib/beszel-agent
65+
- /var/run/docker.sock:/var/run/docker.sock:ro
66+
- /usr/sbin/smartctl:/usr/sbin/smartctl:ro
67+
- /var/lib/smartmontools:/var/lib/smartmontools:ro
68+
devices:
69+
- /dev/sda
70+
- /dev/nvme0n1
71+
1472
glance:
1573
image: glanceapp/glance:latest
1674
container_name: glance
@@ -68,6 +126,51 @@ services:
68126
DOZZLE_AUTH_PROVIDER: simple
69127
restart: unless-stopped
70128

129+
komodo-mongo:
130+
image: mongo:7.0
131+
container_name: komodo-mongo
132+
restart: unless-stopped
133+
environment:
134+
MONGO_INITDB_ROOT_USERNAME: komodo
135+
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
136+
volumes:
137+
- ./komodo/mongo:/data/db
138+
command: ["--quiet", "--wiredTigerCacheSizeGB", "0.25"]
139+
140+
komodo-core:
141+
image: ghcr.io/mbecker20/komodo:latest
142+
container_name: komodo-core
143+
restart: unless-stopped
144+
depends_on:
145+
- komodo-mongo
146+
ports:
147+
- "9120:9120"
148+
environment:
149+
KOMODO_DATABASE_ADDRESS: komodo-mongo:27017
150+
KOMODO_DATABASE_USERNAME: komodo
151+
KOMODO_DATABASE_PASSWORD: ${MONGO_PASS}
152+
KOMODO_PASSKEY: ${KOMODO_PASSKEY}
153+
KOMODO_WEBHOOK_SECRET: ${KOMODO_WEBHOOK_SECRET}
154+
KOMODO_HOST: https://komodo.phanthawas.dev
155+
KOMODO_TITLE: raws-homelab
156+
KOMODO_FIRST_SERVER: http://komodo-periphery:8120
157+
KOMODO_DISABLE_CONFIRM_DIALOG: "false"
158+
KOMODO_LOCAL_AUTH: "true"
159+
KOMODO_DISABLE_USER_REGISTRATION: "true"
160+
KOMODO_ENABLE_NEW_USERS: "true"
161+
162+
komodo-periphery:
163+
image: ghcr.io/mbecker20/periphery:latest
164+
container_name: komodo-periphery
165+
restart: unless-stopped
166+
environment:
167+
PERIPHERY_PASSKEYS: ${KOMODO_PASSKEY}
168+
PERIPHERY_ROOT_DIRECTORY: /etc/komodo
169+
volumes:
170+
- /var/run/docker.sock:/var/run/docker.sock
171+
- ./komodo/periphery:/etc/komodo
172+
- /proc:/proc:ro
173+
71174
yourls-db:
72175
image: mariadb:10
73176
container_name: yourls-db

homelab/infra-compose.yaml

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)