From 3ea1b39e4454dfa06f11e6781d71759f2b6bf42e Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 7 Oct 2026 19:26:27 +0700 Subject: [PATCH] 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 -data. Data on miti-sg was copied into the new volumes beforehand; the old volumes are kept. --- TODO.md | 22 ---------------------- couchbase/README.md | 2 +- couchbase/compose.yml | 4 ++-- goclaw/README.md | 6 +++--- goclaw/compose.yml | 10 +++++----- litellm/README.md | 8 ++++---- litellm/compose.yml | 20 ++++++++++---------- open-webui/README.md | 2 +- open-webui/compose.yml | 4 ++-- owncloud/README.md | 8 ++++---- owncloud/compose.yml | 20 ++++++++++---------- 11 files changed, 42 insertions(+), 64 deletions(-) delete mode 100644 TODO.md diff --git a/TODO.md b/TODO.md deleted file mode 100644 index a112635..0000000 --- a/TODO.md +++ /dev/null @@ -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 `-`. 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`. diff --git a/couchbase/README.md b/couchbase/README.md index e34cbb9..ca9534d 100644 --- a/couchbase/README.md +++ b/couchbase/README.md @@ -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. diff --git a/couchbase/compose.yml b/couchbase/compose.yml index 52c6e3b..c5d1738 100644 --- a/couchbase/compose.yml +++ b/couchbase/compose.yml @@ -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: diff --git a/goclaw/README.md b/goclaw/README.md index e50f5bb..ab960e9 100644 --- a/goclaw/README.md +++ b/goclaw/README.md @@ -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. diff --git a/goclaw/compose.yml b/goclaw/compose.yml index 8c4cbc2..49e4174 100644 --- a/goclaw/compose.yml +++ b/goclaw/compose.yml @@ -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: diff --git a/litellm/README.md b/litellm/README.md index da90f98..f3ffbd1 100644 --- a/litellm/README.md +++ b/litellm/README.md @@ -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 diff --git a/litellm/compose.yml b/litellm/compose.yml index 6cc46e8..cc0e34a 100644 --- a/litellm/compose.yml +++ b/litellm/compose.yml @@ -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: diff --git a/open-webui/README.md b/open-webui/README.md index f76cf7b..1d9dabd 100644 --- a/open-webui/README.md +++ b/open-webui/README.md @@ -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 diff --git a/open-webui/compose.yml b/open-webui/compose.yml index 02932ad..589e796 100644 --- a/open-webui/compose.yml +++ b/open-webui/compose.yml @@ -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: diff --git a/owncloud/README.md b/owncloud/README.md index 2873166..600aa31 100644 --- a/owncloud/README.md +++ b/owncloud/README.md @@ -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 diff --git a/owncloud/compose.yml b/owncloud/compose.yml index f802c7a..c6151fb 100644 --- a/owncloud/compose.yml +++ b/owncloud/compose.yml @@ -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: