-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
172 lines (163 loc) · 5.85 KB
/
docker-compose.dev.yml
File metadata and controls
172 lines (163 loc) · 5.85 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
# =============================================================================
# SerialMemory Development Stack
# =============================================================================
# Complete local development environment for SerialMemory.
#
# Quick Start:
# docker compose -f docker-compose.dev.yml up -d
#
# With bootstrap (first time):
# ./dev-bootstrap.sh # Linux/Mac
# .\dev-bootstrap.ps1 # Windows
#
# Services:
# - PostgreSQL with pgvector: localhost:5435
# - SerialMemory API: localhost:5000
# - Dashboard API: localhost:5001
# - Ollama (embeddings): localhost:11434 (WSL - not in Docker)
# - Prometheus: localhost:9090
# - Grafana: localhost:3001
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Database: PostgreSQL with pgvector
# ---------------------------------------------------------------------------
postgres:
image: pgvector/pgvector:pg17
container_name: serialmemory-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: contextdb
ports:
- "5435:5432"
volumes:
# Initialize all schemas in order
- ./ops/init.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
- ./ops/eventsourcing_schema.sql:/docker-entrypoint-initdb.d/02-eventsourcing.sql:ro
- ./ops/multi_tenant_schema.sql:/docker-entrypoint-initdb.d/03-multi-tenant.sql:ro
- ./ops/rls_policies.sql:/docker-entrypoint-initdb.d/04-rls.sql:ro
- ./ops/usage_metering_schema.sql:/docker-entrypoint-initdb.d/05-usage-metering.sql:ro
- ./ops/admin_actions_schema.sql:/docker-entrypoint-initdb.d/06-admin-actions.sql:ro
- ./dev/seed-data.sql:/docker-entrypoint-initdb.d/99-seed.sql:ro
- postgres_dev_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d contextdb"]
interval: 5s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# Embeddings: Ollama runs locally on WSL (not in Docker)
# Access via host.docker.internal:11434 from containers
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# SerialMemory API (REST + Dashboard)
# ---------------------------------------------------------------------------
api:
build:
context: .
dockerfile: SerialMemory.Api/Dockerfile
container_name: serialmemory-api
ports:
- "5000:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=contextdb
- OLLAMA_BASE_URL=http://host.docker.internal:11434
- OLLAMA_EMBEDDING_MODEL=nomic-embed-text
# Self-hosted mode: bypass JWT auth
- SERIALMEMORY_MODE=self-hosted
# Default tenant for self-hosted
- SERIALMEMORY_DEFAULT_TENANT=00000000-0000-0000-0000-000000000000
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# Dashboard API (Tenant Self-Service)
# ---------------------------------------------------------------------------
dashboard-api:
build:
context: .
dockerfile: SerialMemory.Api.Dashboard/Dockerfile
container_name: serialmemory-dashboard
ports:
- "5001:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=contextdb
- SERIALMEMORY_MODE=self-hosted
depends_on:
postgres:
condition: service_healthy
# ---------------------------------------------------------------------------
# Redis (caching, rate limiting)
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: serialmemory-redis
ports:
- "6379:6379"
volumes:
- redis_dev_data:/data
# ---------------------------------------------------------------------------
# Monitoring: Prometheus + Grafana
# ---------------------------------------------------------------------------
prometheus:
image: prom/prometheus:v2.55.0
container_name: serialmemory-prometheus
ports:
- "9090:9090"
volumes:
- ./ops/prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
grafana:
image: grafana/grafana:11.2.0
container_name: serialmemory-grafana
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_AUTH_ANONYMOUS_ENABLED=true
depends_on:
- prometheus
volumes:
postgres_dev_data:
redis_dev_data:
# =============================================================================
# Usage Notes
# =============================================================================
#
# Start all services:
# docker compose -f docker-compose.dev.yml up -d
#
# View logs:
# docker compose -f docker-compose.dev.yml logs -f api
#
# Stop all services:
# docker compose -f docker-compose.dev.yml down
#
# Reset database (removes all data):
# docker compose -f docker-compose.dev.yml down -v
#
# Ollama runs locally on WSL - ensure it's running:
# wsl ollama serve
# wsl ollama pull nomic-embed-text
#
# =============================================================================