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