-
Notifications
You must be signed in to change notification settings - Fork 417
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
244 lines (236 loc) · 7.7 KB
/
docker-compose.yml
File metadata and controls
244 lines (236 loc) · 7.7 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
services:
# MongoDB (for conversations, workflows, and data persistence)
mongodb:
image: mongo:7
container_name: claraverse-mongodb
ports:
- "27017:27017"
volumes:
- mongodb-data:/data/db
environment:
- MONGO_INITDB_DATABASE=claraverse
deploy:
resources:
limits:
memory: 1g
cpus: "1.0"
restart: unless-stopped
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
networks:
- claraverse-network
# Redis (for scheduled jobs + WebSocket pub/sub)
# Required for: scheduled agent triggers, cross-instance messaging
redis:
image: redis:7-alpine
container_name: claraverse-redis
command: redis-server --appendonly yes --maxmemory 100mb --maxmemory-policy allkeys-lru
ports:
- "6379:6379"
volumes:
- redis-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
start_period: 5s
retries: 5
networks:
- claraverse-network
# MySQL (for providers, models, and capabilities)
# Replaces SQLite for production-ready persistence
mysql:
image: mysql:8.0
container_name: claraverse-mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
ports:
- "3306:3306"
volumes:
- mysql-data-new:/var/lib/mysql
- ./backend/migrations:/docker-entrypoint-initdb.d:ro
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-claraverse_root_2024}
- MYSQL_DATABASE=claraverse
- MYSQL_USER=claraverse_user
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-claraverse_pass_2024}
deploy:
resources:
limits:
memory: 2g
cpus: "1.0"
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-claraverse_root_2024}"]
interval: 10s
timeout: 5s
start_period: 30s
retries: 5
networks:
- claraverse-network
searxng:
image: searxng/searxng:latest
container_name: claraverse-searxng
volumes:
- ./searxng/settings.yml:/etc/searxng/settings.yml:ro
environment:
- SEARXNG_BASE_URL=http://searxng:8080/
- SEARXNG_HOSTNAME=searxng
cap_add:
- SETUID
- SETGID
restart: unless-stopped
networks:
- claraverse-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/"]
interval: 30s
timeout: 3s
start_period: 15s
retries: 3
# E2B Code Interpreter (optional - requires E2B_API_KEY)
# Uncomment and set E2B_API_KEY in .env to enable
# e2b-service:
# build:
# context: ./backend/e2b-service
# dockerfile: Dockerfile
# container_name: claraverse-e2b
# environment:
# - E2B_API_KEY=${E2B_API_KEY}
# restart: unless-stopped
# healthcheck:
# test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8001/health')"]
# interval: 30s
# timeout: 10s
# start_period: 5s
# retries: 3
# networks:
# - claraverse-network
backend:
build:
context: ./backend
dockerfile: Dockerfile
args:
SKIP_TESTS: "true"
container_name: claraverse-backend
ports:
- "3001:3001"
deploy:
resources:
limits:
memory: 1g
cpus: "2.0"
volumes:
# Persistent data
- backend-data:/app/data
- backend-uploads:/app/uploads
- backend-logs:/app/logs
environment:
# All values from root .env file (single source of truth)
- ENVIRONMENT=${ENVIRONMENT:-development}
# Override paths for Docker environment
- DATABASE_URL=${DATABASE_URL:-mysql://claraverse_user:${MYSQL_PASSWORD:-claraverse_pass_2024}@mysql:3306/claraverse?parseTime=true}
- MYSQL_DATABASE=claraverse
- UPLOAD_DIR=/app/uploads
# CORS
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-http://localhost:5173}
# SearXNG integration (supports multiple URLs for load balancing)
- SEARXNG_URLS=${SEARXNG_URLS:-http://searxng:8080}
- SEARXNG_URL=${SEARXNG_URLS:-http://searxng:8080}
# E2B service integration
- E2B_SERVICE_URL=http://e2b-service:8001
# Frontend URL
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:5173}
# Backend public URL for generating absolute download URLs
- BACKEND_URL=${BACKEND_URL:-http://localhost:3001}
# MongoDB
- MONGODB_URI=${MONGODB_URI:-mongodb://mongodb:27017/claraverse}
# Redis (for scheduler + pub/sub)
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
# JWT Secret for local auth tokens
- JWT_SECRET=${JWT_SECRET:-local_test_jwt_secret_32chars_min}
- JWT_ACCESS_TOKEN_EXPIRY=${JWT_ACCESS_TOKEN_EXPIRY:-15m}
- JWT_REFRESH_TOKEN_EXPIRY=${JWT_REFRESH_TOKEN_EXPIRY:-168h}
# Encryption key for user data
- ENCRYPTION_MASTER_KEY=${ENCRYPTION_MASTER_KEY}
# Development API key for testing (only works when ENVIRONMENT != production)
- DEV_API_KEY=${DEV_API_KEY:-claraverse-dev-key-2024}
# Admin
- SUPERADMIN_USER_IDS=${SUPERADMIN_USER_IDS:-}
# Composio (optional integrations)
- COMPOSIO_API_KEY=${COMPOSIO_API_KEY}
- COMPOSIO_GOOGLESHEETS_AUTH_CONFIG_ID=${COMPOSIO_GOOGLESHEETS_AUTH_CONFIG_ID}
- COMPOSIO_GMAIL_AUTH_CONFIG_ID=${COMPOSIO_GMAIL_AUTH_CONFIG_ID}
- COMPOSIO_LINKEDIN_AUTH_CONFIG_ID=${COMPOSIO_LINKEDIN_AUTH_CONFIG_ID}
- COMPOSIO_GOOGLECALENDAR_AUTH_CONFIG_ID=${COMPOSIO_GOOGLECALENDAR_AUTH_CONFIG_ID}
- COMPOSIO_GOOGLEDRIVE_AUTH_CONFIG_ID=${COMPOSIO_GOOGLEDRIVE_AUTH_CONFIG_ID}
- COMPOSIO_CANVA_AUTH_CONFIG_ID=${COMPOSIO_CANVA_AUTH_CONFIG_ID}
- COMPOSIO_TWITTER_AUTH_CONFIG_ID=${COMPOSIO_TWITTER_AUTH_CONFIG_ID}
- COMPOSIO_YOUTUBE_AUTH_CONFIG_ID=${COMPOSIO_YOUTUBE_AUTH_CONFIG_ID}
- COMPOSIO_ZOOM_AUTH_CONFIG_ID=${COMPOSIO_ZOOM_AUTH_CONFIG_ID}
# Rate Limiting
- RATE_LIMIT_GLOBAL_API=${RATE_LIMIT_GLOBAL_API:-200}
- RATE_LIMIT_PUBLIC_READ=${RATE_LIMIT_PUBLIC_READ:-120}
- RATE_LIMIT_AUTHENTICATED=${RATE_LIMIT_AUTHENTICATED:-60}
- RATE_LIMIT_WEBSOCKET=${RATE_LIMIT_WEBSOCKET:-20}
- RATE_LIMIT_IMAGE_PROXY=${RATE_LIMIT_IMAGE_PROXY:-60}
depends_on:
mongodb:
condition: service_healthy
mysql:
condition: service_healthy
searxng:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health"]
interval: 30s
timeout: 3s
start_period: 10s
retries: 3
networks:
- claraverse-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:3001}
VITE_WS_URL: ${VITE_WS_URL:-ws://localhost:3001}
container_name: claraverse-frontend
ports:
- "80:80"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/health"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3
networks:
- claraverse-network
volumes:
backend-data:
driver: local
backend-uploads:
driver: local
backend-logs:
driver: local
mongodb-data:
driver: local
mysql-data-new:
driver: local
redis-data:
driver: local
networks:
claraverse-network:
driver: bridge