refactor: name supporting services and volumes by role

Rename database services to db and cache services to cache, with their
volumes as db-data and cache-data, in litellm, owncloud and goclaw. Rename
the couchbase and open-webui volumes to <service>-data. Data on miti-sg was
copied into the new volumes beforehand; the old volumes are kept.
This commit is contained in:
tiennm99 committed 2026-10-07 19:26:27 +07:00
1 parent 29f52dfcb3
commit 3ea1b39e44
11 files changed
+42 -64

No files matched your search

-22
View File
@@ -1,22 +0,0 @@
# TODO
## Supporting service and volume names
Supporting containers take a role name — `db` for a database, `cache` for
Redis-like stores — and volumes are `<service>-<what it holds>`. Renaming a
volume on a running deployment orphans its data, so each rename needs a volume
migration (the `migrate-service` skill), not just an edit. A service rename
also changes the hostname other containers reach it by. Update the service
README in the same change.
- [ ] `litellm` — service `postgres` → `db` and volume `pg-data` → `db-data`;
service `redis` → `cache` and volume `redis-data` → `cache-data`. Point
`DATABASE_URL` at `db` and `REDIS_HOST` at `cache`.
- [ ] `owncloud` — service `mariadb` → `db` and volume `owncloud-mysql-data` →
`db-data`; service `redis` → `cache` and volume `owncloud-redis-data` →
`cache-data`. Point `OWNCLOUD_DB_HOST` at `db` and `OWNCLOUD_REDIS_HOST`
at `cache`.
- [ ] `goclaw` — service `postgres` → `db` and volume `postgres-data` →
`db-data`. Point the host in `GOCLAW_POSTGRES_DSN` at `db`.
- [ ] `couchbase` — volume `couchbase_data` → `couchbase-data`.
- [ ] `open-webui` — volume `open-webui` → `open-webui-data`.
+1 -1
View File
@@ -19,4 +19,4 @@ The admin console is on `8091`. Complete the first-run setup there.
## Storage
`couchbase_data` at `/opt/couchbase/var` — data, indexes, config, logs.
`couchbase-data` at `/opt/couchbase/var` — data, indexes, config, logs.
+2 -2
View File
@@ -9,8 +9,8 @@ services:
- "11280:11280"
- "18091-18097:18091-18097"
volumes:
- couchbase_data:/opt/couchbase/var
- couchbase-data:/opt/couchbase/var
restart: unless-stopped
volumes:
couchbase_data:
couchbase-data:
+3 -3
View File
@@ -5,7 +5,7 @@ providers, messaging channels (Telegram, Discord, Slack, Zalo, Feishu,
WhatsApp), agent teams, and a knowledge vault, behind one binary with a
built-in web dashboard.
Two containers: `goclaw`, and `postgres` — pgvector, which holds tenants,
Two containers: `goclaw`, and `db` — pgvector, which holds tenants,
sessions, encrypted provider keys and the semantic memory.
## Setup
@@ -75,14 +75,14 @@ and stored encrypted in PostgreSQL.
| --- | --- | --- |
| `goclaw-data` | `/app/data` | `config.json`, skills, Claude CLI credentials, runtime packages |
| `goclaw-workspace` | `/app/workspace` | Files the agents work on |
| `postgres-data` | `/var/lib/postgresql` | The database |
| `db-data` | `/var/lib/postgresql` | The database |
Upstream's PostgreSQL overlay adds a third `goclaw-skills` volume at
`/app/skills`; it is not here, because `GOCLAW_SKILLS_DIR` points at
`/app/data/skills` and the volume would mount empty over a path nothing reads.
Skills persist in `goclaw-data` instead.
`postgres-data` mounts `/var/lib/postgresql`, not `/var/lib/postgresql/data`.
`db-data` mounts `/var/lib/postgresql`, not `/var/lib/postgresql/data`.
PostgreSQL 18 images moved `PGDATA` down a level into a version directory, so
the parent is now the mount point.
+5 -5
View File
@@ -5,7 +5,7 @@ services:
environment:
- GOCLAW_GATEWAY_TOKEN=${GOCLAW_GATEWAY_TOKEN:?required}
- GOCLAW_ENCRYPTION_KEY=${GOCLAW_ENCRYPTION_KEY:?required}
- GOCLAW_POSTGRES_DSN=postgres://${POSTGRES_USER:-goclaw}:${POSTGRES_PASSWORD:-goclaw}@postgres:5432/${POSTGRES_DB:-goclaw}?sslmode=disable
- GOCLAW_POSTGRES_DSN=postgres://${POSTGRES_USER:-goclaw}:${POSTGRES_PASSWORD:-goclaw}@db:5432/${POSTGRES_DB:-goclaw}?sslmode=disable
- GOCLAW_HOST=0.0.0.0
- GOCLAW_PORT=18790
- GOCLAW_CONFIG=/app/data/config.json
@@ -19,7 +19,7 @@ services:
- goclaw-data:/app/data
- goclaw-workspace:/app/workspace
depends_on:
postgres:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:18790/health || exit 1"]
@@ -48,7 +48,7 @@ services:
pids: 200
# PostgreSQL 18 with pgvector, for agent memory and the knowledge vault.
postgres:
db:
image: pgvector/pgvector:pg18
restart: unless-stopped
environment:
@@ -56,7 +56,7 @@ services:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-goclaw}
POSTGRES_DB: ${POSTGRES_DB:-goclaw}
volumes:
- postgres-data:/var/lib/postgresql
- db-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-goclaw} -d ${POSTGRES_DB:-goclaw}"]
interval: 5s
@@ -66,4 +66,4 @@ services:
volumes:
goclaw-data:
goclaw-workspace:
postgres-data:
db-data:
+4 -4
View File
@@ -4,8 +4,8 @@
front of many LLM providers, with virtual keys, spend tracking and an admin UI
at `/ui`.
Three containers: `litellm`, `postgres` for keys, teams, budgets and spend
logs, and `redis` for the response cache.
Three containers: `litellm`, `db` (PostgreSQL) for keys, teams, budgets and spend
logs, and `cache` (Redis) for the response cache.
## Setup
@@ -64,8 +64,8 @@ enabled by uncommenting its line, without touching `config.yaml`.
| Volume | Mount | Holds |
| --- | --- | --- |
| `pg-data` | `/var/lib/postgresql/data` | The database |
| `redis-data` | `/data` | Redis append-only file |
| `db-data` | `/var/lib/postgresql/data` | The database |
| `cache-data` | `/data` | Redis append-only file |
## Images
+10 -10
View File
@@ -6,8 +6,8 @@ services:
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY:?required}
- UI_USERNAME=${UI_USERNAME:-admin}
- UI_PASSWORD=${UI_PASSWORD:?required}
- DATABASE_URL=postgresql://${POSTGRES_USER:-litellm}:${POSTGRES_PASSWORD:?required}@postgres:5432/${POSTGRES_DB:-litellm}
- REDIS_HOST=redis
- DATABASE_URL=postgresql://${POSTGRES_USER:-litellm}:${POSTGRES_PASSWORD:?required}@db:5432/${POSTGRES_DB:-litellm}
- REDIS_HOST=cache
- REDIS_PORT=6379
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
@@ -35,9 +35,9 @@ services:
- --max_requests_before_restart
- "1000"
depends_on:
postgres:
db:
condition: service_healthy
redis:
cache:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request;urllib.request.urlopen('http://127.0.0.1:4000/health/liveliness',timeout=5)"]
@@ -51,7 +51,7 @@ services:
memory: 4G
# PostgreSQL for keys, teams, budgets and spend logs.
postgres:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
@@ -59,7 +59,7 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?required}
- POSTGRES_DB=${POSTGRES_DB:-litellm}
volumes:
- pg-data:/var/lib/postgresql/data
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
@@ -67,12 +67,12 @@ services:
retries: 3
# Redis for the response cache and router state.
redis:
cache:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis-data:/data
- cache-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
@@ -80,5 +80,5 @@ services:
retries: 3
volumes:
pg-data:
redis-data:
db-data:
cache-data:
+1 -1
View File
@@ -40,7 +40,7 @@ connections exist the admin UI is where they change.
| Volume | Mount | Holds |
| --- | --- | --- |
| `open-webui` | `/app/backend/data` | `webui.db`, uploads, the vector database, and model cache |
| `open-webui-data` | `/app/backend/data` | `webui.db`, uploads, the vector database, and model cache |
## Image
+2 -2
View File
@@ -9,7 +9,7 @@ services:
# - OPENAI_API_KEY=${OPENAI_API_KEY:-}
# - OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-}
volumes:
- open-webui:/app/backend/data
- open-webui-data:/app/backend/data
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080"]
interval: 5s
@@ -17,4 +17,4 @@ services:
retries: 10
volumes:
open-webui:
open-webui-data:
+4 -4
View File
@@ -3,8 +3,8 @@
[ownCloud](https://doc.owncloud.com/server/10.16/admin_manual/installation/docker/)
Server: file sync and share, with web, desktop and mobile clients.
Three containers: `owncloud`, `mariadb` for metadata, users and shares, and
`redis` for file locking and the distributed cache.
Three containers: `owncloud`, `db` (MariaDB) for metadata, users and shares, and
`cache` (Redis) for file locking and the distributed cache.
## Setup
@@ -41,8 +41,8 @@ connection rather than changing the password.
| Volume | Mount | Holds |
| --- | --- | --- |
| `owncloud-data` | `/mnt/data` | User files, apps, `config.php` |
| `owncloud-mysql-data` | `/var/lib/mysql` | The database |
| `owncloud-redis-data` | `/data` | Redis locks and cache |
| `db-data` | `/var/lib/mysql` | The database |
| `cache-data` | `/data` | Redis locks and cache |
The Redis volume follows ownCloud's own compose. Its contents are rebuilt
after a restart, but the `redis` image declares `/data` a volume, so without a
+10 -10
View File
@@ -8,19 +8,19 @@ services:
- OWNCLOUD_ADMIN_USERNAME=${OWNCLOUD_ADMIN_USERNAME:-admin}
- OWNCLOUD_ADMIN_PASSWORD=${OWNCLOUD_ADMIN_PASSWORD:?required}
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_DB_HOST=db
- OWNCLOUD_DB_NAME=${DB_NAME:-owncloud}
- OWNCLOUD_DB_USERNAME=${DB_USER:-owncloud}
- OWNCLOUD_DB_PASSWORD=${DB_PASSWORD:?required}
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
- OWNCLOUD_REDIS_HOST=cache
volumes:
- owncloud-data:/mnt/data
depends_on:
mariadb:
db:
condition: service_healthy
redis:
cache:
condition: service_healthy
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
@@ -29,7 +29,7 @@ services:
retries: 5
# MariaDB for file metadata, users and shares.
mariadb:
db:
image: mariadb:12
restart: unless-stopped
command:
@@ -43,7 +43,7 @@ services:
- MYSQL_USER=${DB_USER:-owncloud}
- MYSQL_PASSWORD=${DB_PASSWORD:?required}
volumes:
- owncloud-mysql-data:/var/lib/mysql
- db-data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
@@ -51,12 +51,12 @@ services:
retries: 10
# Redis for file locking and the distributed cache.
redis:
cache:
image: redis:6
restart: unless-stopped
command: ["--databases", "1"]
volumes:
- owncloud-redis-data:/data
- cache-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
@@ -65,5 +65,5 @@ services:
volumes:
owncloud-data:
owncloud-mysql-data:
owncloud-redis-data:
db-data:
cache-data: