-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
286 lines (260 loc) · 7.02 KB
/
docker-compose.yml
File metadata and controls
286 lines (260 loc) · 7.02 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
version: '3.8'
services:
# SPECTRA Web Server
spectra:
build:
context: .
dockerfile: Dockerfile
container_name: spectra-web
environment:
# Core Settings
SPECTRA_DEBUG: "false"
SPECTRA_HOST: "0.0.0.0"
SPECTRA_PORT: "5000"
# Security - CHANGE THESE IN PRODUCTION!
SPECTRA_JWT_SECRET: "${SPECTRA_JWT_SECRET:-change-me-in-production-use-strong-secret}"
SPECTRA_CORS_ORIGINS: "http://localhost:3000,http://localhost:5000"
# Database
SPECTRA_DATABASE_PATH: "/app/data/spectra.db"
# Logging
SPECTRA_LOG_LEVEL: "INFO"
SPECTRA_LOG_FILE: "/app/logs/spectra.log"
# Rate Limiting
SPECTRA_RATE_LIMIT: "100"
SPECTRA_RATE_LIMIT_WINDOW: "60"
# Session
SPECTRA_SESSION_TIMEOUT: "3600"
SPECTRA_REMEMBER_ME_TIMEOUT: "2592000" # 30 days
# Features
SPECTRA_ENABLE_FTS: "true"
SPECTRA_ENABLE_SEARCH: "true"
SPECTRA_ENABLE_EXPORT: "true"
SPECTRA_ENABLE_ANALYTICS: "true"
# Vector Database (Qdrant)
SPECTRA_QDRANT_ENABLED: "true"
SPECTRA_QDRANT_URL: "http://qdrant:6333"
SPECTRA_EMBEDDING_MODEL: "all-MiniLM-L6-v2"
SPECTRA_EMBEDDING_DIM: "384"
ports:
- "5000:5000"
volumes:
# Data persistence
- spectra-data:/app/data
- spectra-logs:/app/logs
- spectra-config:/app/config
# Optional: Mount config file
# - ./config/spectra.yaml:/app/config/spectra.yaml:ro
# Restart policy
restart: unless-stopped
# Resource limits
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G
# Logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Network
networks:
- spectra-network
# Caddy Reverse Proxy for Automated SSL & Secure Access
caddy:
image: caddy:latest
container_name: spectra-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
SITE_ADDRESS: "${SITE_ADDRESS:-localhost}"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy-data:/data
- caddy-config:/config
- spectra-logs:/var/log/caddy
depends_on:
- spectra
networks:
- spectra-network
deploy:
resources:
limits:
memory: 512M
# ============================================================================
# MEMSHADOW SIDECAR - Advanced Memory Persistence & Semantic Analysis
# ============================================================================
memshadow-db:
image: postgres:15-alpine
container_name: memshadow-postgres
restart: unless-stopped
environment:
POSTGRES_USER: memshadow
POSTGRES_PASSWORD: ${MEMSHADOW_POSTGRES_PASSWORD:-1786}
POSTGRES_DB: memshadow
volumes:
- memshadow-postgres-data:/var/lib/postgresql/data
networks:
- spectra-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U memshadow"]
interval: 10s
timeout: 5s
retries: 5
memshadow-cache:
image: redis:7-alpine
container_name: memshadow-redis
restart: unless-stopped
command: redis-server --requirepass ${MEMSHADOW_REDIS_PASSWORD:-1786}
volumes:
- memshadow-redis-data:/data
networks:
- spectra-network
healthcheck:
test: ["CMD", "redis-cli", "-a", "${MEMSHADOW_REDIS_PASSWORD:-1786}", "ping"]
interval: 10s
timeout: 5s
retries: 5
memshadow-vector:
image: chromadb/chroma:latest
container_name: memshadow-chromadb
restart: unless-stopped
environment:
CHROMA_SERVER_AUTH_PROVIDER: "chromadb.auth.token.TokenAuthServerProvider"
CHROMA_SERVER_AUTH_CREDENTIALS: ${MEMSHADOW_CHROMA_TOKEN:-1786}
volumes:
- memshadow-chroma-data:/chroma/chroma
networks:
- spectra-network
memshadow:
build:
context: ./src/MEMSHADOW
dockerfile: Dockerfile
container_name: memshadow-app
restart: unless-stopped
depends_on:
memshadow-db:
condition: service_healthy
memshadow-cache:
condition: service_healthy
environment:
# Database
POSTGRES_SERVER: memshadow-db
POSTGRES_USER: memshadow
POSTGRES_PASSWORD: ${MEMSHADOW_POSTGRES_PASSWORD:-1786}
POSTGRES_DB: memshadow
# Redis
REDIS_HOST: memshadow-cache
REDIS_PASSWORD: ${MEMSHADOW_REDIS_PASSWORD:-1786}
REDIS_URL: redis://:1786@memshadow-cache:6379/0
# Chroma
CHROMA_HOST: memshadow-vector
CHROMA_PORT: "8000"
# Features
ENABLE_SECURITY_MIDDLEWARE: "true"
WEB_ADMIN_PASSWORD: ${MEMSHADOW_ADMIN_PASSWORD:-1786}
EMBEDDING_DIMENSION: "4096"
# Safety: Explicitly disable blackbox mode
MEMSHADOW_BLACKBOX_MODE: "false"
networks:
- spectra-network
# Qdrant Vector Database for Semantic Search (Enabled by default)
qdrant:
image: qdrant/qdrant:latest
container_name: spectra-qdrant
ports:
- "6333:6333" # REST API
- "6334:6334" # gRPC API
volumes:
- spectra-qdrant:/qdrant/storage
environment:
QDRANT_API_KEY: "${QDRANT_API_KEY:-optional-api-key-change-in-production}"
networks:
- spectra-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6333/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
# Optional: Redis for caching and WebSocket support
# redis:
# image: redis:7-alpine
# container_name: spectra-redis
# ports:
# - "6379:6379"
# volumes:
# - spectra-redis:/data
# networks:
# - spectra-network
# restart: unless-stopped
# command: redis-server --appendonly yes
# security_opt:
# - no-new-privileges:true
# Optional: Nginx reverse proxy for production
# nginx:
# image: nginx:alpine
# container_name: spectra-nginx
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# - ./certs:/etc/nginx/certs:ro
# - spectra-logs:/var/log/nginx
# networks:
# - spectra-network
# depends_on:
# - spectra
# restart: unless-stopped
# security_opt:
# - no-new-privileges:true
volumes:
spectra-data:
driver: local
spectra-logs:
driver: local
spectra-config:
driver: local
spectra-qdrant:
driver: local
memshadow-postgres-data:
driver: local
memshadow-redis-data:
driver: local
memshadow-chroma-data:
driver: local
caddy-data:
driver: local
caddy-config:
driver: local
# spectra-redis:
# driver: local
networks:
spectra-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16