Skip to content

Commit 9f0c330

Browse files
committed
normalized homebox, llama-router and nextcloud
missing Redis doc
1 parent 8fae5cd commit 9f0c330

11 files changed

Lines changed: 116 additions & 33 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Redis persistence in this hackstack
2+
3+
Stacks under `apps/` that run a dedicated Redis container are tuned to **reduce SSD write wear** while staying as safe as practical.
4+
5+
## Policy
6+
7+
| Stack | Redis role | AOF | RDB | Notes |
8+
|-------|------------|-----|-----|--------|
9+
| **authentik** | Cache / coordination for server + worker | **off** | **off** (`save ""`) | Accept **re-login** and cold cache after unclean restart. **Removes** the previous `--save 60 1` (very write-heavy). |
10+
| **glitchtip** | Celery broker + cache | **off** | **`save 900 1`** only | No AOF (big SSD win). At most one snapshot per **15 minutes** if keys changed. Hard crash can still lose in-flight Celery work not yet in Postgres. |
11+
| **member-manager** | Sidekiq queue | **off** | **`save 900 1`** only | Same tradeoff as GlitchTip for **queued jobs**. |
12+
| **event-manager** | Sidekiq queue | **off** | **`save 900 1`** only | Same as member-manager. |
13+
| **sentry** | Queues / internal cache | **off** | **`save 900 1`** only | Same pattern; **requirepass** unchanged. |
14+
15+
## Why not disable RDB everywhere?
16+
17+
For **Celery / Sidekiq / Sentry**, Redis often holds **work not yet reflected in PostgreSQL**. Disabling **all** disk persistence (`save ""`) maximizes wear savings but increases the chance of **lost queued tasks** after a clean shutdown if the last save was stale. A **single** infrequent `save 900 1` keeps **much lower** write volume than Redis defaults (or Authentik’s old `save 60 1`) while still allowing periodic checkpoints.
18+
19+
## Operational notes
20+
21+
- After changing these settings, **restart** the Redis service (or full stack) so the new `command` applies.
22+
- Existing `dump.rdb` files under each app’s `lib/.../redis` volume are still used on startup until removed; that’s normal.
23+
- If you need **stronger** queue durability for one app, tighten that stack only (e.g. add `save 300 10` or enable AOF with `appendfsync everysec`) at the cost of more SSD writes.

experiments/homebox/.rsync-exclude

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
config/confg.yml

experiments/homebox/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ For **`latest-rootless`** or **`latest-hardened`**, see the [HomeBox quick start
4040
- **`postgres-net`** — database (`postgresql` hostname)
4141
- **`nginx-proxy-net`** — reverse proxy to container port **7745**
4242

43+
## Healthcheck
44+
45+
`wget` to **`http://127.0.0.1:7745/api/v1/status`** inside the container (no dependency on `localhost` DNS).
46+
4347
## Usage
4448

4549
### Start

experiments/homebox/docker-compose.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,25 @@ services:
44
container_name: homebox
55
hostname: homebox
66
restart: unless-stopped
7-
env_file:
8-
- .env
97
volumes:
108
- ../../lib/homebox:/data
11-
# ports:
12-
# - 3100:7745
13-
networks:
14-
- proxy
15-
- db
9+
env_file:
10+
- .env
1611
healthcheck:
1712
test:
1813
[
19-
"CMD",
20-
"wget",
21-
"--no-verbose",
22-
"--tries=1",
23-
"-O",
24-
"-",
25-
"http://localhost:7745/api/v1/status",
14+
"CMD-SHELL",
15+
"wget -q -O - http://127.0.0.1:7745/api/v1/status >/dev/null || exit 1",
2616
]
2717
interval: 30s
28-
timeout: 5s
18+
timeout: 10s
2919
retries: 3
3020
start_period: 15s
21+
# ports:
22+
# - 3100:7745
23+
networks:
24+
- proxy
25+
- db
3126

3227
networks:
3328
proxy:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# Pin image tag (optional)
2+
IMAGE_VERSION=latest
3+
14
LLAMA_ROUTER_DATABASE_PATH=/app/data/llama_router.db
25
LLAMA_ROUTER_CACHE_EXTERNAL_HOST=llama-router.ctrlh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

experiments/llama-router/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# llama-router (experiment)
2+
3+
[llama-router](https://github.com/romkey/llama-router) routes requests across multiple Ollama and llama.cpp backends and optional OCI model cache.
4+
5+
## Configuration
6+
7+
Copy **`.env.example`** to **`.env`**. Set **`LLAMA_ROUTER_CACHE_EXTERNAL_HOST`** to a hostname or IP your Ollama backends use to reach the cache (see upstream README). Use **`IMAGE_VERSION`** to pin the image tag.
8+
9+
Persistent data: **`../../lib/llama-router`** (mounted at **`/app/data`**).
10+
11+
## Networks
12+
13+
- **`nginx-proxy-net`** — reverse proxy to dashboard (**`:80`**) and/or APIs if you publish ports or use a proxy container.
14+
15+
## Healthcheck
16+
17+
**`GET /health`** on **`127.0.0.1:80`** (dashboard), then **`:11434`**, then **`:8080`**, via **`python3`** (the image is `python:3.12-slim` and does not include `curl`). Port **9200** is the OCI cache registry only—not used for liveness.
18+
19+
## Usage
20+
21+
```bash
22+
docker compose up -d
23+
docker compose down
24+
docker compose logs -f
25+
```
26+
27+
## Ports (optional)
28+
29+
Uncomment **`ports`** in **`docker-compose.yml`** only if needed. Defaults inside the image: dashboard **80**, llama.cpp/OpenAI API **8080**, Ollama API **11434**, registry cache **9200**.
Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,45 @@
11
services:
22
llama-router:
3-
image: ghcr.io/romkey/llama-router:latest
3+
image: ghcr.io/romkey/llama-router:${IMAGE_VERSION:-latest}
44
container_name: llama-router
55
hostname: llama-router
6-
ports:
7-
# - "80:80"
8-
# - "11434:11434"
9-
- 9200:9200
6+
restart: unless-stopped
107
volumes:
118
- ../../lib/llama-router:/app/data
129
env_file:
1310
- .env
14-
restart: unless-stopped
11+
# GET /health on dashboard (80), Ollama API (11434), or llama.cpp API (8080). Uses python3 — slim image has no curl.
12+
healthcheck:
13+
test:
14+
- CMD
15+
- python3
16+
- -c
17+
- |
18+
import urllib.request
19+
for u in (
20+
"http://127.0.0.1:80/health",
21+
"http://127.0.0.1:11434/health",
22+
"http://127.0.0.1:8080/health",
23+
):
24+
try:
25+
urllib.request.urlopen(u, timeout=5)
26+
raise SystemExit(0)
27+
except Exception:
28+
pass
29+
raise SystemExit(1)
30+
interval: 30s
31+
timeout: 10s
32+
retries: 3
33+
start_period: 30s
34+
# ports:
35+
# - 80:80
36+
# - 8080:8080
37+
# - 11434:11434
38+
# - 9200:9200
1539
networks:
1640
- proxy
41+
1742
networks:
1843
proxy:
19-
name: nginx-proxy-net
2044
external: true
45+
name: nginx-proxy-net

experiments/nextcloud/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Optional: pin Nextcloud image (see docker-compose)
2-
#IMAGE_VERSION=latest
1+
# Pin Nextcloud image tag (optional)
2+
IMAGE_VERSION=latest
33

44
POSTGRES_DB=nextcloud_db
55
POSTGRES_USER=nextcloud_user

experiments/nextcloud/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Configuration reference: [Nextcloud Docker environment variables](https://github
1313
- **`nginx-proxy-net`** — reverse proxy to the web container (port **80** inside the container unless you change it)
1414
- **`postgres-net`** — PostgreSQL as `postgresql:5432`
1515

16+
## Healthcheck
17+
18+
`curl` to **`http://127.0.0.1/status.php`** inside the container. **HTTP 503** usually means maintenance mode, upgrade in progress, or DB/config issues—not a bad healthcheck definition.
19+
1620
## Usage
1721

1822
```bash

0 commit comments

Comments
 (0)