-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
162 lines (151 loc) · 4.45 KB
/
docker-compose.dev.yml
File metadata and controls
162 lines (151 loc) · 4.45 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
# SynthStack Local Development Docker Compose
# Usage: docker compose -f docker-compose.dev.yml up -d
version: '3.8'
services:
# =========================================
# PostgreSQL Database
# =========================================
postgres:
image: postgres:16-alpine
container_name: synthstack-postgres
restart: unless-stopped
ports:
- "5450:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: synthstack
volumes:
- postgres-data:/var/lib/postgresql/data
- ./services/directus/migrations:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d synthstack" ]
interval: 5s
timeout: 5s
retries: 5
# =========================================
# Redis Cache
# =========================================
redis:
image: redis:7-alpine
container_name: synthstack-redis
restart: unless-stopped
ports:
- "6390:6379"
command: redis-server --appendonly yes
volumes:
- redis-data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5
# =========================================
# API Gateway (for local development)
# =========================================
api:
image: node:20-alpine
container_name: synthstack-api
restart: unless-stopped
working_dir: /app
ports:
- "3030:3000"
environment:
NODE_ENV: development
PORT: 3000
DATABASE_URL: postgres://postgres:postgres@postgres:5432/synthstack
REDIS_URL: redis://redis:6379
DIRECTUS_URL: http://directus:8055
JWT_SECRET: dev-jwt-secret-change-in-production
SUPABASE_URL: ${SUPABASE_URL:-}
SUPABASE_SERVICE_KEY: ${SUPABASE_SERVICE_KEY:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./packages/api-gateway:/app
- api-node-modules:/app/node_modules
command: sh -c "npm install -g pnpm && pnpm install && pnpm dev"
healthcheck:
# Use Node (already in image) for a fast health probe without installing curl/wget
test:
- CMD
- node
- -e
- "require('http').get('http://127.0.0.1:3000/health', r => { if (r.statusCode === 200) process.exit(0); process.exit(1); }).on('error', () => process.exit(1));"
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
# =========================================
# ML Service (TypeScript/NestJS) - Community Edition
# =========================================
ts-ml-service:
build:
context: .
dockerfile: packages/ts-ml-service/Dockerfile
container_name: synthstack-ts-ml
restart: unless-stopped
ports:
- "8030:8001"
environment:
NODE_ENV: development
PORT: 8001
REDIS_URL: redis://redis:6379
DATABASE_URL: postgres://postgres:postgres@postgres:5432/synthstack
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
depends_on:
- redis
healthcheck:
test:
- CMD
- node
- -e
- "require('http').get('http://127.0.0.1:8001/health', r => { if (r.statusCode === 200) process.exit(0); process.exit(1); }).on('error', () => process.exit(1));"
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
# =========================================
# Directus CMS (optional, for content management)
# =========================================
directus:
image: directus/directus:10
container_name: synthstack-directus
restart: unless-stopped
ports:
- "8056:8055"
environment:
KEY: dev-directus-key
SECRET: dev-directus-secret
DB_CLIENT: pg
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: synthstack
DB_USER: postgres
DB_PASSWORD: postgres
ADMIN_EMAIL: admin@synthstack.app
ADMIN_PASSWORD: admin123
PUBLIC_URL: http://localhost:8055
depends_on:
postgres:
condition: service_healthy
# =========================================
# Mailhog (for email testing)
# =========================================
mailhog:
image: mailhog/mailhog:latest
container_name: synthstack-mailhog
ports:
- "1030:1025" # SMTP
- "8035:8025" # Web UI
networks:
default:
name: synthstack-dev
volumes:
postgres-data:
redis-data:
api-node-modules: