Cutting a 12‑container stack to 4
说明与用途
将12个容器的堆栈缩减为4个容器,同时保持核心功能并简化启动。
问题
A self‑hosted project’s README lists 12 services, making it intimidating for new users. The goal was to determine which services could be removed or folded into others without breaking functionality.
结果
The stack was reduced from 12 to 4 running containers, saving ~3.5 GB of image size and simplifying startup while preserving core functionality.
工作流
- 1. Identify hard dependencies via health‑check logic (database, object storage).
- 2. Test local‑filesystem storage; discover permission issues inside the image, so keep MinIO.
- 3. Evaluate Milvus+etcd group; confirm lazy connection allows API to start but readiness is slow; keep as unit.
- 4. Verify Vault can be omitted by using in‑process secrets; note data loss on restart.
- 5. Assess Redis usage: event bus, permission cache, rate limiting; remove if no rate limits are set.
- 6. Fold outbox‑dispatcher into API by setting
outbox_dispatcher_enabled=true. - 7. Run the trimmed stack with
docker compose up -d --no-deps webto avoid health‑check delays. - 8. Verify UI and API health endpoints.
- 9. Document the final Compose command and service list.
证据
"PermissionError: [Errno 13] Permission denied: '/app/home'"
"{\"status\":\"ready\",\"database\":\"connected\",\"storage\":\"connected\",\"vector\":\"unavailable\"}"
- 记录日期: 2026-09-22T14:30:48.790Z