-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.community.yml
More file actions
337 lines (299 loc) · 9.52 KB
/
docker-compose.community.yml
File metadata and controls
337 lines (299 loc) · 9.52 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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# SynthStack Community Edition - Docker Compose
# Free & Source-Available Core Platform
#
# This is the Community Edition without AI features (Qdrant, ML Service).
# AI Co-Founders, GitHub integration, and proactive suggestions require Premium.
#
# Usage:
# docker-compose -f docker-compose.community.yml up -d
#
# For Premium Edition features, use the main docker-compose.yml
services:
# ============================================
# PostgreSQL Database
# ============================================
postgres:
image: pgvector/pgvector:pg15
container_name: synthstack-postgres
env_file:
- .env
environment:
POSTGRES_DB: ${DB_DATABASE:-synthstack}
POSTGRES_USER: ${DB_USER:-synthstack}
POSTGRES_PASSWORD: ${DB_PASSWORD:-change-this-password}
ports:
- "5499:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-synthstack} -d ${DB_DATABASE:-synthstack}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- synthstack
# ============================================
# Redis Cache
# ============================================
redis:
image: redis:7-alpine
container_name: synthstack-redis
command: redis-server --appendonly yes
ports:
- "6399:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- synthstack
# ============================================
# Directus CMS
# ============================================
directus:
build:
context: ./services/directus
dockerfile: Dockerfile
container_name: synthstack-directus
ports:
- "8099:8055"
env_file:
- .env
environment:
# Security Keys
KEY: ${DIRECTUS_KEY:-synthstack-key-change-in-production}
SECRET: ${DIRECTUS_SECRET:-synthstack-secret-change-in-production}
# Database
DB_CLIENT: pg
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: ${DB_DATABASE:-synthstack}
DB_USER: ${DB_USER:-synthstack}
DB_PASSWORD: ${DB_PASSWORD:-change-this-password}
# Cache
CACHE_ENABLED: "true"
CACHE_STORE: redis
REDIS: redis://redis:6379
# Admin
ADMIN_EMAIL: ${DIRECTUS_ADMIN_EMAIL:[email protected]}
ADMIN_PASSWORD: ${DIRECTUS_ADMIN_PASSWORD:-change-this-password}
ADMIN_TOKEN: ${DIRECTUS_ADMIN_TOKEN:-replace-with-secure-token}
# CORS
PUBLIC_URL: ${DIRECTUS_PUBLIC_URL:-http://localhost:8099}
CORS_ENABLED: "true"
CORS_ORIGIN: "http://localhost:3000,http://localhost:3003,http://localhost:5174"
# Storage
STORAGE_LOCATIONS: local
STORAGE_LOCAL_ROOT: ./uploads
# Logging
LOG_LEVEL: info
LOG_STYLE: pretty
# Extensions
EXTENSIONS_AUTO_RELOAD: "true"
# Community Edition Flag
SYNTHSTACK_EDITION: community
volumes:
- directus_uploads:/directus/uploads
- ./services/directus/extensions:/directus/extensions
- ./services/directus/snapshots:/directus/snapshots
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://0.0.0.0:8055/server/ping || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
restart: unless-stopped
networks:
- synthstack
# ============================================
# Database Migrations (Runs after Directus creates its schema)
# ============================================
directus-migrate:
image: postgres:15-alpine
container_name: synthstack-migrate
env_file:
- .env
environment:
PGHOST: postgres
PGPORT: 5432
PGDATABASE: ${DB_DATABASE:-synthstack}
PGUSER: ${DB_USER:-synthstack}
PGPASSWORD: ${DB_PASSWORD:-change-this-password}
depends_on:
directus:
condition: service_healthy
volumes:
- ./services/directus/migrations:/migrations:ro
entrypoint: [ "/bin/sh", "-c" ]
command:
- |
echo "Running SynthStack database migrations..."
echo "Waiting for Directus to initialize its schema..."
# Wait for Directus to create its tables (max 60 seconds)
for i in $$(seq 1 60); do
if psql -At -c "SELECT 1 FROM information_schema.tables WHERE table_name = 'directus_users' LIMIT 1;" | grep -q 1; then
echo "Directus schema ready!"
break
fi
echo "Waiting for Directus schema... ($$i/60)"
sleep 1
done
# Ensure migration tracking table exists
psql -v ON_ERROR_STOP=1 -c "CREATE TABLE IF NOT EXISTS synthstack_migrations (filename TEXT PRIMARY KEY, applied_at TIMESTAMPTZ NOT NULL DEFAULT NOW());"
# Run each migration file once (in lexicographic order)
for f in /migrations/*.sql; do
if [ -f "$$f" ]; then
NAME=$$(basename "$$f")
APPLIED=$$(psql -At -c "SELECT 1 FROM synthstack_migrations WHERE filename = '$$NAME' LIMIT 1;")
if [ "$$APPLIED" = "1" ]; then
echo "Skipping already applied: $$NAME"
continue
fi
echo "Running migration: $$NAME"
psql -v ON_ERROR_STOP=1 -f "$$f"
psql -v ON_ERROR_STOP=1 -c "INSERT INTO synthstack_migrations (filename) VALUES ('$$NAME');"
fi
done
echo ""
echo "Migrations complete!"
restart: "no"
networks:
- synthstack
# ============================================
# API Gateway (Fastify + Node.js)
# Community Edition - No AI features
# ============================================
api-gateway:
build:
context: .
dockerfile: packages/api-gateway/Dockerfile.dev
container_name: synthstack-api-gateway
ports:
- "3003:3003"
env_file:
- .env
environment:
NODE_ENV: development
PORT: 3003
HOST: 0.0.0.0
# Community Edition Flag
SYNTHSTACK_EDITION: community
# Database
DATABASE_URL: postgresql://${DB_USER:-synthstack}:${DB_PASSWORD:-change-this-password}@postgres:5432/${DB_DATABASE:-synthstack}
# Directus
DIRECTUS_URL: http://directus:8055
DIRECTUS_TOKEN: ${DIRECTUS_ADMIN_TOKEN:-replace-with-secure-token}
# Supabase
SUPABASE_URL: ${SUPABASE_URL}
SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
# Redis
REDIS_URL: redis://redis:6379
# CORS
CORS_ORIGIN: "http://localhost:3000,http://localhost:5174,http://localhost:8099,http://localhost:3050"
# Stripe (optional for community)
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
# AI - Disabled in Community Edition
# These are not used but prevent errors if configured
OPENAI_API_KEY: ""
ANTHROPIC_API_KEY: ""
# Vector DB - Disabled in Community Edition
QDRANT_URL: ""
# ML Service - Disabled in Community Edition
ML_SERVICE_URL: ""
volumes:
- ./packages/api-gateway/src:/app/packages/api-gateway/src
- api_gateway_node_modules:/app/node_modules
depends_on:
directus:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- synthstack
# ============================================
# Web Frontend (Vue 3 + Quasar) - Development
# ============================================
web:
build:
context: ./apps/web
dockerfile: Dockerfile.dev
container_name: synthstack-web
ports:
- "3050:3050"
env_file:
- .env
environment:
NODE_ENV: development
HOST: 0.0.0.0
PORT: 3050
# Community Edition Flag
VITE_SYNTHSTACK_EDITION: community
# API URLs
VITE_API_URL: http://localhost:3003
VITE_DIRECTUS_URL: http://localhost:8099
# Supabase
VITE_SUPABASE_URL: ${SUPABASE_URL}
VITE_SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
# App Config
VITE_APP_NAME: "SynthStack Community"
VITE_APP_URL: http://localhost:3050
# Stripe (optional for community)
VITE_STRIPE_PUBLISHABLE_KEY: ${STRIPE_PUBLISHABLE_KEY}
volumes:
- ./apps/web/src:/app/src
- ./apps/web/public:/app/public
depends_on:
- api-gateway
restart: unless-stopped
networks:
- synthstack
# ============================================
# Volumes
# ============================================
volumes:
postgres_data:
driver: local
redis_data:
driver: local
directus_uploads:
driver: local
api_gateway_node_modules:
driver: local
# ============================================
# Networks
# ============================================
networks:
synthstack:
driver: bridge
ipam:
config:
- subnet: 172.31.0.0/16
# ============================================
# Notes for Community Edition
# ============================================
#
# This Community Edition excludes:
# - Qdrant vector database (for AI RAG)
# - ML Service (Python AI backend)
# - AI Co-Founders agents
# - AI Suggestions system
# - GitHub integration
#
# To upgrade to Premium Edition:
# 1. Purchase a lifetime license at synthstack.app/pricing
# 2. Switch to docker-compose.yml (main file)
# 3. Set SYNTHSTACK_EDITION=premium in your .env
# 4. Restart containers: docker-compose up -d