-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.postgres.yaml
More file actions
213 lines (195 loc) · 8.08 KB
/
Copy pathdocker-compose.prod.postgres.yaml
File metadata and controls
213 lines (195 loc) · 8.08 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
##############################################################################
# UAR Production Docker Compose — PostgreSQL persistence (+ pgvector)
#
# Primary application persistence is **PostgreSQL** (`UAR_PERSISTENCE__PROVIDER=postgres`).
# **SurrealDB** runs as a separate service for agent memory / graph (`UAR_MEMORY__SURREAL_*`).
#
# docker compose -f docker-compose.prod.postgres.yaml --env-file .env up -d
#
# For **Surreal-backed persistence** instead, use:
# docker-compose.prod.yaml
#
# Services:
# postgres — PostgreSQL 17 with pgvector + pgmq + UAR migrations
# redis — Redis 7 with AOF persistence
# surreal — SurrealDB v2 (memory / knowledge-graph backend for UAR memory)
# surrealist — SurrealDB web UI (http://localhost:8080)
# dbgate — DB admin UI for Postgres (http://localhost:5050)
# uar — Universal Agent Runtime (http://localhost:1906)
#
# Prerequisites:
# - Docker Desktop or Docker Engine + Compose v2
# - Copy .env.example to .env and fill in secrets (JWT, LLM keys, etc.)
##############################################################################
name: uar-prod
services:
# ── PostgreSQL 17 ────────────────────────────────────────────────────────────
postgres:
image: tribehealth/uar-postgres:pg17
container_name: uar-postgres
restart: unless-stopped
env_file: .env
environment:
POSTGRES_USER: ${POSTGRES_USER:-uar}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-uar}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-uar} -d ${POSTGRES_DB:-uar}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- uar-net
# ── Redis 7 ─────────────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
container_name: uar-redis
restart: unless-stopped
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- redis-data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- uar-net
# ── SurrealDB 3.3.0 (agent memory / graph — not primary UAR persistence here) ─
surreal:
image: surrealdb/surrealdb:v3.3.0@sha256:681c6c22c287421b5c7d99e0fde79b6e0d32c36c1ddeaab2762a1661cb04cd20
container_name: uar-surreal
restart: unless-stopped
command:
- start
- --user=${SURREAL_USER:-root}
- --pass=${SURREAL_PASS:-changeme}
- --bind=0.0.0.0:8000
- rocksdb:/data/memory.db
volumes:
- surreal-data:/data
ports:
- "8000:8000"
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
networks:
- uar-net
# ── Surrealist UI ────────────────────────────────────────────────────────────
surrealist:
image: ghcr.io/surrealdb/surrealist:latest
container_name: uar-surrealist
restart: unless-stopped
ports:
- "8080:8080"
depends_on:
surreal:
condition: service_healthy
networks:
- uar-net
# ── DbGate — PostgreSQL admin ───────────────────────────────────────────────
dbgate:
image: dbgate/dbgate:latest
container_name: uar-dbgate
restart: unless-stopped
environment:
- CONNECTIONS=con1
- LABEL_con1=UAR Postgres
- SERVER_con1=postgres
- PORT_con1=5432
- USER_con1=${POSTGRES_USER:-uar}
- PASSWORD_con1=${POSTGRES_PASSWORD:-changeme}
- DATABASE_con1=${POSTGRES_DB:-uar}
- ENGINE_con1=postgres@dbgate-plugin-postgres
ports:
- "5050:3000"
depends_on:
postgres:
condition: service_healthy
networks:
- uar-net
# ── Universal Agent Runtime ──────────────────────────────────────────────────
uar:
image: tribehealth/universal-agent-runtime:latest
container_name: uar-app
restart: unless-stopped
env_file: .env
environment:
# ── Server ─────────────────────────────────────────────────────────────
UAR_SERVER__PORT: "${UAR_SERVER__PORT:-1906}"
UAR_SERVER__GRPC_PORT: "50051"
UAR_SERVER__HOST: "0.0.0.0"
# ── Persistence: Postgres (primary) ───────────────────────────────────
UAR_PERSISTENCE__PROVIDER: "postgres"
UAR_PERSISTENCE__DATABASE_URL: postgres://${POSTGRES_USER:-uar}:${POSTGRES_PASSWORD:-changeme}@postgres:5432/${POSTGRES_DB:-uar}
UAR_PERSISTENCE__VECTOR_DIMENSION: "1536"
UAR_PERSISTENCE__EXTERNAL_CACHE_ENABLED: "true"
# Legacy / tooling — some scripts still read DATABASE_URL
DATABASE_URL: postgres://${POSTGRES_USER:-uar}:${POSTGRES_PASSWORD:-changeme}@postgres:5432/${POSTGRES_DB:-uar}
# ── Redis (session / cache when external_cache_enabled) ─────────────────
REDIS_URL: redis://redis:6379
# ── Agent memory — SurrealDB over the network (same surreal service) ──
UAR_MEMORY__ENABLED: "true"
UAR_MEMORY__EMBEDDING_PROVIDER: "openai"
UAR_MEMORY__EMBEDDING_MODEL: "text-embedding-3-small"
UAR_MEMORY__AUTO_CAPTURE: "true"
UAR_MEMORY__INJECT_CONTEXT: "true"
UAR_MEMORY__MCP_HTTP_ENABLED: "true"
UAR_MEMORY__SURREAL_ENDPOINT: "ws://surreal:8000"
UAR_MEMORY__SURREAL_USER: ${SURREAL_USER:-root}
UAR_MEMORY__SURREAL_PASS: ${SURREAL_PASS:-changeme}
# ── Security ───────────────────────────────────────────────────────────
UAR_SECURITY__JWT_REQUIRED: "false"
# ── File processing ─────────────────────────────────────────────────────
UAR_FILE_PROCESSING__PROVIDER: "unstructured"
UAR_FILE_PROCESSING__UPLOAD_DIR: "/uploads"
UAR_UNSTRUCTURED__API_URL: "https://api.unstructured.io/general/v0/general"
# ── LLM ─────────────────────────────────────────────────────────────────
LLM_PROTOCOL: "auto"
# ── Observability ───────────────────────────────────────────────────────
RUST_LOG: "info"
volumes:
- uar-uploads:/uploads
- uar-data:/data
ports:
- "${APP_PORT:-1906}:${UAR_SERVER__PORT:-1906}"
- "50051:50051"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
surreal:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:$${UAR_SERVER__PORT:-1906}/healthz || exit 1"]
interval: 15s
timeout: 5s
retries: 10
start_period: 30s
networks:
- uar-net
volumes:
postgres-data:
driver: local
redis-data:
driver: local
surreal-data:
driver: local
uar-uploads:
driver: local
uar-data:
driver: local
networks:
uar-net:
driver: bridge