-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (95 loc) · 2.32 KB
/
docker-compose.yml
File metadata and controls
99 lines (95 loc) · 2.32 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
version: "3.9"
services:
# PostgreSQL with pgvector
db:
image: pgvector/pgvector:pg16
container_name: aegis-postgres
restart: unless-stopped
environment:
POSTGRES_DB: aegis
POSTGRES_USER: aegis
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-aegis}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# Production PostgreSQL tuning
command:
- "postgres"
- "-c"
- "max_connections=200"
- "-c"
- "shared_buffers=512MB"
- "-c"
- "effective_cache_size=1536MB"
- "-c"
- "maintenance_work_mem=128MB"
- "-c"
- "checkpoint_completion_target=0.9"
- "-c"
- "wal_buffers=16MB"
- "-c"
- "default_statistics_target=100"
- "-c"
- "random_page_cost=1.1"
- "-c"
- "effective_io_concurrency=200"
- "-c"
- "work_mem=64MB"
- "-c"
- "min_wal_size=1GB"
- "-c"
- "max_wal_size=4GB"
- "-c"
- "max_worker_processes=4"
- "-c"
- "max_parallel_workers_per_gather=2"
- "-c"
- "max_parallel_workers=4"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U aegis -d aegis"]
interval: 10s
timeout: 5s
retries: 5
# Aegis API
aegis:
build:
context: ./server
dockerfile: Dockerfile
container_name: aegis-api
restart: unless-stopped
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql+asyncpg://aegis:${POSTGRES_PASSWORD:-aegis}@db:5432/aegis
OPENAI_API_KEY: ${OPENAI_API_KEY}
AEGIS_API_KEY: ${AEGIS_API_KEY:-dev-secret-key}
DB_POOL_SIZE: 20
DB_MAX_OVERFLOW: 10
RATE_LIMIT_PER_MINUTE: 60
RATE_LIMIT_PER_HOUR: 1000
depends_on:
db:
condition: service_healthy
volumes:
- ./playbooks:/app/playbooks:ro # Mount playbooks for genesis loading
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# Optional: Redis for distributed rate limiting
redis:
image: redis:7-alpine
container_name: aegis-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
profiles:
- with-redis
volumes:
postgres_data:
redis_data: