forked from DreamLab-AI/origin-logseq-AR
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocker-compose.unified-with-neo4j.yml
More file actions
262 lines (253 loc) · 7.92 KB
/
docker-compose.unified-with-neo4j.yml
File metadata and controls
262 lines (253 loc) · 7.92 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# Extension fields for DRY configuration
x-common-environment: &common-environment
NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES:-0}
NVIDIA_DRIVER_CAPABILITIES: compute,utility
CUDA_ARCH: ${CUDA_ARCH:-86}
SYSTEM_NETWORK_PORT: ${SYSTEM_NETWORK_PORT:-4000}
# Neo4j Configuration (REQUIRED for backend)
NEO4J_URI: ${NEO4J_URI:-bolt://neo4j:7687}
NEO4J_USER: ${NEO4J_USER:-neo4j}
NEO4J_PASSWORD: ${NEO4J_PASSWORD}
NEO4J_DATABASE: ${NEO4J_DATABASE:-neo4j}
# MCP and Claude Flow configuration
CLAUDE_FLOW_HOST: ${CLAUDE_FLOW_HOST:-agentic-workstation}
MCP_HOST: ${MCP_HOST:-agentic-workstation}
MCP_TCP_PORT: ${MCP_TCP_PORT:-9500}
MCP_TRANSPORT: ${MCP_TRANSPORT:-tcp}
MCP_RECONNECT_ATTEMPTS: ${MCP_RECONNECT_ATTEMPTS:-3}
MCP_RECONNECT_DELAY: ${MCP_RECONNECT_DELAY:-1000}
MCP_CONNECTION_TIMEOUT: ${MCP_CONNECTION_TIMEOUT:-30000}
ORCHESTRATOR_WS_URL: ${ORCHESTRATOR_WS_URL:-ws://mcp-orchestrator:9001/ws}
MCP_RELAY_FALLBACK_TO_MOCK: ${MCP_RELAY_FALLBACK_TO_MOCK:-true}
BOTS_ORCHESTRATOR_URL: ${BOTS_ORCHESTRATOR_URL:-ws://agentic-workstation:3002}
MANAGEMENT_API_HOST: ${MANAGEMENT_API_HOST:-agentic-workstation}
MANAGEMENT_API_PORT: ${MANAGEMENT_API_PORT:-9090}
x-common-healthcheck: &common-healthcheck
test: ["CMD", "curl", "-f", "http://localhost:4000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
x-common-logging: &common-logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
x-gpu-resources: &gpu-resources
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu, compute, utility]
services:
# Neo4j Graph Database - REQUIRED for VisionFlow backend
neo4j:
container_name: ${NEO4J_CONTAINER_NAME:-visionflow-neo4j}
image: neo4j:5.13.0
environment:
# Authentication
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD}
# Memory configuration
- NEO4J_dbms_memory_pagecache_size=${NEO4J_PAGECACHE_SIZE:-512M}
- NEO4J_dbms_memory_heap_initial__size=${NEO4J_HEAP_INIT:-512M}
- NEO4J_dbms_memory_heap_max__size=${NEO4J_HEAP_MAX:-1G}
# Plugins (optional but recommended)
- NEO4J_PLUGINS=["apoc"]
# Transaction timeout
- NEO4J_dbms_transaction_timeout=${NEO4J_TX_TIMEOUT:-120s}
# Logging (disabled deprecated settings for Neo4j 5.x)
# - NEO4J_server_logs_user_stdout_enabled=true
- NEO4J_dbms_logs_debug_level=${NEO4J_DEBUG:-INFO}
ports:
- "${NEO4J_HTTP_PORT:-7474}:7474" # HTTP (Neo4j Browser)
- "${NEO4J_BOLT_PORT:-7687}:7687" # Bolt protocol
volumes:
- neo4j-data:/data
- neo4j-logs:/logs
- neo4j-import:/var/lib/neo4j/import
- neo4j-plugins:/plugins
networks:
docker_ragflow:
aliases:
- neo4j
restart: unless-stopped
healthcheck:
test: ["CMD", "cypher-shell", "-u", "${NEO4J_USER:-neo4j}", "-p", "${NEO4J_PASSWORD}", "RETURN 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging:
<<: *common-logging
profiles:
- development
- dev
- production
- prod
# Unified VisionFlow service with profile-based configuration
visionflow:
container_name: ${CONTAINER_NAME:-visionflow_container}
hostname: ${HOSTNAME:-webxr}
build:
context: .
dockerfile: ${DOCKERFILE:-Dockerfile.unified}
target: development
args:
CUDA_ARCH: ${CUDA_ARCH:-86}
BUILD_TARGET: ${BUILD_TARGET:-development}
env_file:
- .env
environment:
<<: *common-environment
# Development-specific variables (overridden in production profile)
NODE_ENV: ${NODE_ENV:-development}
VITE_DEBUG: ${DEBUG_ENABLED:-true}
VITE_DEV_SERVER_PORT: ${VITE_DEV_SERVER_PORT:-5173}
VITE_API_PORT: ${VITE_API_PORT:-4000}
VITE_HMR_PORT: ${VITE_HMR_PORT:-24678}
RUST_LOG: ${RUST_LOG:-info,webxr::adapters::neo4j_ontology_repository=warn,webxr::actors::graph_state_actor=warn,actix_web=warn}
RUST_LOG_REDIRECT: ${RUST_LOG_REDIRECT:-true}
DOCKER_ENV: ${DOCKER_ENV:-true}
volumes:
# Data volumes - ALWAYS mounted (both dev and prod)
- visionflow-data:/app/data
- visionflow-logs:/app/logs
# Cache volumes for build optimization
- npm-cache:/root/.npm
- cargo-cache:/root/.cargo/registry
- cargo-git-cache:/root/.cargo/git
- cargo-target-cache:/app/target
# Docker socket for controlled access (development only)
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
# Development: Nginx entry point + API port
- "${DEV_NGINX_PORT:-3001}:3001"
- "${API_PORT:-4000}:4000"
networks:
docker_ragflow:
aliases:
- ${NETWORK_ALIAS:-webxr}
depends_on:
neo4j:
condition: service_healthy
deploy:
<<: *gpu-resources
runtime: nvidia
restart: unless-stopped
healthcheck:
<<: *common-healthcheck
logging:
<<: *common-logging
profiles:
- development
- dev
# Production profile configuration
visionflow-production:
container_name: ${CONTAINER_NAME:-visionflow_prod_container}
hostname: ${HOSTNAME:-webxr-prod}
build:
context: .
dockerfile: Dockerfile.production
args:
CUDA_ARCH: ${CUDA_ARCH:-86}
BUILD_TARGET: production
REBUILD_PTX: ${REBUILD_PTX:-false}
env_file:
- .env
environment:
<<: *common-environment
# Production-specific overrides
NODE_ENV: production
RUST_LOG: ${RUST_LOG:-warn}
GIT_HASH: ${GIT_HASH:-production}
VITE_DEBUG: "false"
volumes:
# Production: ONLY data volumes (no source mounts, no Docker socket)
- visionflow-data:/app/data
- visionflow-logs:/app/logs
ports:
# Production: Only API port
- "${PROD_API_PORT:-4000}:4000"
networks:
docker_ragflow:
aliases:
- ${NETWORK_ALIAS:-webxr-prod}
depends_on:
neo4j:
condition: service_healthy
deploy:
<<: *gpu-resources
runtime: nvidia
restart: unless-stopped
healthcheck:
<<: *common-healthcheck
logging:
<<: *common-logging
profiles:
- production
- prod
# Cloudflare tunnel - works with both profiles
cloudflared:
container_name: ${CLOUDFLARED_CONTAINER:-cloudflared-tunnel}
image: cloudflare/cloudflared:latest
command: tunnel --no-autoupdate run
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
volumes:
- ./config.yml:/etc/cloudflared/config.yml:ro
depends_on:
visionflow:
condition: service_started
required: false
visionflow-production:
condition: service_started
required: false
networks:
- docker_ragflow
restart: unless-stopped
logging:
<<: *common-logging
profiles:
- development
- dev
- production
- prod
networks:
docker_ragflow:
external: true
name: ${EXTERNAL_NETWORK:-docker_ragflow}
volumes:
# Neo4j volumes
neo4j-data:
name: ${NEO4J_DATA_VOLUME:-visionflow-neo4j-data}
driver: local
neo4j-logs:
name: ${NEO4J_LOGS_VOLUME:-visionflow-neo4j-logs}
driver: local
neo4j-import:
name: ${NEO4J_IMPORT_VOLUME:-visionflow-neo4j-import}
driver: local
neo4j-plugins:
name: ${NEO4J_PLUGINS_VOLUME:-visionflow-neo4j-plugins}
driver: local
# Persistent data volumes
visionflow-data:
name: ${DATA_VOLUME_NAME:-visionflow-data}
driver: local
visionflow-logs:
name: ${LOGS_VOLUME_NAME:-visionflow-logs}
driver: local
# Build cache volumes
npm-cache:
name: ${NPM_CACHE_VOLUME:-visionflow-npm-cache}
driver: local
cargo-cache:
name: ${CARGO_CACHE_VOLUME:-visionflow-cargo-cache}
driver: local
cargo-git-cache:
name: ${CARGO_GIT_CACHE_VOLUME:-visionflow-cargo-git-cache}
driver: local
cargo-target-cache:
name: ${CARGO_TARGET_CACHE_VOLUME:-visionflow-cargo-target-cache}
driver: local