Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
149 lines (138 loc) · 6.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
149 lines (138 loc) · 6.38 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# =============================================================================
# Assistant stack — supporting services
#
# This file defines the SHARED infrastructure: Squid (allowlisted egress),
# OneCLI (vault + MITM proxy + dashboard), OneCLI DB, LiteLLM (model routing),
# and PrivateMode Proxy (TEE enclave). It contains ZERO agent-tier definitions.
#
# Agent tiers (ZeroClaw containers + MCP gateways + optional DinD sandboxes)
# are defined in tiers.yaml and GENERATED into docker-compose.tiers.yml:
#
# scripts/generate-tiers.py
# docker compose -f docker-compose.yml -f docker-compose.tiers.yml up -d
#
# Networks:
# assistant-net internal: true (NO direct internet — fail-closed floor)
# egress-net bridged, internet — ONLY squid is attached -> sole way out
# =============================================================================
networks:
assistant-net:
name: assistant-net # fixed name so spawned containers can join it
driver: bridge
internal: true
attachable: true
egress-net:
driver: bridge
# ---------------------------------------------------------------------------
# admin-net — DEV ONLY (Mac local). NON-internal bridge so Docker Desktop can
# route host->container for the dashboards (an `internal: true` net refuses
# this — that's the localhost:10254 "connection refused" you hit). Only
# dashboard-bearing services attach here; the DATA PLANE stays on assistant-net.
# PIVOT: when moving to Tailscale, DELETE the `ports:` from the services below
# and attach the tailscale sidecar to admin-net instead. On a real Unraid VM
# this net is unnecessary (ssh on-box + 127.0.0.1). See PROJECT-STATE.
# ---------------------------------------------------------------------------
admin-net:
driver: bridge
volumes:
onecli-db:
onecli-ca:
privatemode-data:
# =========================================================================
# Agent-tier volumes (zeroclaw-*-data, *-workspace, dind-*-data) are
# defined in docker-compose.tiers.yml (generated from tiers.yaml).
# =========================================================================
services:
# =========================================================================
# SUPPORTING STACK — unchanged from Option A'' (already verified working)
# =========================================================================
# ----------------------------------------------------------------- squid ---
squid:
image: ubuntu/squid:latest # VERIFY/pin by digest
container_name: squid
restart: unless-stopped
networks: [assistant-net, egress-net]
volumes:
- ./squid/squid.conf:/etc/squid/squid.conf:ro
- ./squid/allowlist.txt:/etc/squid/allowlist.txt:ro
# NOTE: allowlist must now also permit the container registry the DinD pulls
# tool images from (e.g. registry-1.docker.io, ghcr.io, *.docker.io CDN). See
# README 5-A / HARD-WON LESSON about wildcard-vs-subdomain overlap before adding.
# --------------------------------------------------------------- onecli-db -
onecli-db:
image: postgres:16-alpine
container_name: onecli-db
restart: unless-stopped
networks: [assistant-net]
environment:
POSTGRES_USER: onecli
POSTGRES_PASSWORD: ${ONECLI_DB_PASSWORD}
POSTGRES_DB: onecli
volumes:
- onecli-db:/var/lib/postgresql/data
healthcheck: # so onecli waits for a READY db, not just a started one
test: ["CMD-SHELL", "pg_isready -U onecli -d onecli"]
interval: 5s
timeout: 3s
retries: 10
# ------------------------------------------------------------------ onecli -
# Vault + MITM gateway + dashboard. Create THREE-but-really-TWO identities:
# 'personal' (updates tier) + 'tasks'. 'unrestricted' brokers NO SaaS creds,
# so it needs no OneCLI identity. See onecli/VAULT-SETUP.md.
onecli:
image: ghcr.io/onecli/onecli:latest # VERIFY/pin by digest
container_name: onecli
restart: unless-stopped
depends_on:
onecli-db:
condition: service_healthy # wait for pg_isready, not just container start
squid:
condition: service_started
networks: [assistant-net, admin-net] # admin-net = DEV ONLY dashboard reach (see networks)
environment:
SECRET_ENCRYPTION_KEY: ${ONECLI_SECRET_ENCRYPTION_KEY}
DATABASE_URL: postgres://onecli:${ONECLI_DB_PASSWORD}@onecli-db:5432/onecli
HTTP_PROXY: http://squid:3128 # VERIFY 3.1 (OneCLI's own egress via squid)
HTTPS_PROXY: http://squid:3128
NO_PROXY: onecli-db,litellm,privatemode-proxy,localhost,127.0.0.1
volumes:
- onecli-ca:/data/ca # VERIFY CA path; export CA here
ports:
- "127.0.0.1:10254:10254" # dashboard — localhost only
healthcheck:
test: ["CMD-SHELL", "nc -z 127.0.0.1 10255 && wget -qO- http://127.0.0.1:10254/api/health >/dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
# -------------------------------------------------------- privatemode-proxy -
privatemode-proxy:
image: ghcr.io/edgelesssys/privatemode/privatemode-proxy:latest # VERIFY/pin
container_name: privatemode-proxy
restart: unless-stopped
depends_on: [squid]
networks: [assistant-net]
command: ["--apiKey=${PRIVATEMODE_API_KEY}", "--port=8080"] # VERIFY flags
environment:
HTTPS_PROXY: http://squid:3128 # enclave leg via allowlist (no bump)
NO_PROXY: localhost,127.0.0.1
volumes:
- privatemode-data:/data
# ------------------------------------------------------------------ litellm -
litellm:
image: ghcr.io/berriai/litellm:main-stable # VERIFY: pin >= 1.83.0 by digest
container_name: litellm
restart: unless-stopped
depends_on: [privatemode-proxy]
networks: [assistant-net]
environment:
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
PRIVATEMODE_API_KEY: ${PRIVATEMODE_API_KEY}
NO_PROXY: privatemode-proxy,localhost,127.0.0.1
volumes:
- ./litellm/config.yaml:/app/config.yaml:ro
command: ["--config", "/app/config.yaml", "--port", "4000"]
# =========================================================================
# Agent-tier services (MCP gateways + ZeroClaw + optional DinD) are
# defined in docker-compose.tiers.yml (generated from tiers.yaml).
# =========================================================================