-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathdocker-compose.prebuilt.yml
More file actions
99 lines (96 loc) · 4.5 KB
/
Copy pathdocker-compose.prebuilt.yml
File metadata and controls
99 lines (96 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# OpenBiliClaw backend via the prebuilt multi-arch image on GHCR.
#
# This file is self-contained — no git clone or local build needed:
#
# curl -fsSLO https://raw.githubusercontent.com/whiteguo233/OpenBiliClaw/main/docker-compose.prebuilt.yml
# docker compose -f docker-compose.prebuilt.yml up -d
# # then open http://127.0.0.1:8420/setup/ for AI config + prereq checks,
# # and run the (container-required) init step from the host:
# # docker exec -it openbiliclaw-backend openbiliclaw init
#
# Upgrade to the newest release:
#
# docker compose -f docker-compose.prebuilt.yml pull
# docker compose -f docker-compose.prebuilt.yml up -d
#
# To build from source instead (customization / development), use the
# docker-compose.yml at the repository root — see docs/docker-deployment.md.
services:
# Ollama sidecar — bundled embedding service so users don't need to
# install Ollama on their host. Pulls bge-m3 on first start (~1.1GB,
# CPU-only) and keeps the daemon running on the internal Docker
# network at http://ollama:11434. The backend's [llm.embedding] gets
# seeded to point here automatically on first config bootstrap.
#
# Prefer a cloud embedding provider instead? Remove this block plus
# the backend's depends_on and OPENBILICLAW_SEED_OLLAMA_DEFAULTS.
ollama:
# Prebuilt multi-arch image with bge-m3 BAKED IN (~1.1GB), published by
# .github/workflows/release-docker.yml. Its entrypoint seeds the baked
# model into the store before serving — ZERO network pull, offline-ready.
image: ghcr.io/whiteguo233/openbiliclaw-ollama:${OPENBILICLAW_VERSION:-latest}
container_name: openbiliclaw-ollama
volumes:
- openbiliclaw_ollama:/root/.ollama
# Set OPENBILICLAW_OLLAMA_ALLOW_PULL=1 to opt into a network pull if the
# baked seed is ever missing/corrupt (default: fail loud, not degrade).
healthcheck:
# Healthy = daemon up AND bge-m3 is locally available (seconds with the
# baked seed; start_period stays generous only for opt-in runtime pull).
test: ["CMD-SHELL", "ollama list 2>/dev/null | grep -q '^bge-m3'"]
interval: 30s
timeout: 10s
retries: 6
start_period: 300s
restart: unless-stopped
openbiliclaw-backend:
# Multi-arch image (linux/amd64 + linux/arm64) published by
# .github/workflows/release-docker.yml on every backend release.
# Pin a specific version by replacing `latest` with e.g. `0.3.152`.
image: ghcr.io/whiteguo233/openbiliclaw-backend:latest
container_name: openbiliclaw-backend
depends_on:
# service_started (not service_healthy) on purpose: the sidecar is
# only "healthy" once bge-m3 finished downloading. A health gate
# here would keep the backend from ever starting when the first
# pull fails — instead the backend boots immediately and /setup/
# surfaces "embedding not ready yet" until the pull completes.
ollama:
condition: service_started
environment:
OPENBILICLAW_PROJECT_ROOT: /app/runtime
OPENBILICLAW_CONFIG_TEMPLATE: /app/config.example.toml
OPENBILICLAW_PROXY_HOST: ${OPENBILICLAW_PROXY_HOST:-host.docker.internal}
OPENBILICLAW_PROXY_PORT: ${OPENBILICLAW_PROXY_PORT:-7897}
OPENBILICLAW_PROXY_TIMEOUT: ${OPENBILICLAW_PROXY_TIMEOUT:-1.0}
# On first config bootstrap, seed [llm.ollama] base_url and
# [llm.embedding] to point at the bundled sidecar above. Existing
# config.toml is never overwritten.
OPENBILICLAW_SEED_OLLAMA_DEFAULTS: "1"
OPENBILICLAW_OLLAMA_BASE_URL: "http://ollama:11434/v1"
OPENBILICLAW_EMBEDDING_MODEL: "bge-m3"
# ``host.docker.internal`` resolves the host machine from inside the
# container (proxy auto-detect, host-side Ollama). Required on Linux
# Docker; auto-provided by Docker Desktop on Mac / Windows.
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8420:8420"
volumes:
- openbiliclaw_config:/app/runtime
- openbiliclaw_data:/app/runtime/data
- openbiliclaw_logs:/app/runtime/logs
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8420/api/health', timeout=4).status==200 else 1)"]
interval: 30s
timeout: 5s
start_period: 20s
retries: 3
restart: unless-stopped
volumes:
openbiliclaw_config:
openbiliclaw_data:
openbiliclaw_logs:
# Persists ollama models across container recreations so users don't
# have to re-pull bge-m3 on every rebuild.
openbiliclaw_ollama: