forked from kagura-ai/memory-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (123 loc) · 3.51 KB
/
docker-compose.yml
File metadata and controls
135 lines (123 loc) · 3.51 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
# Kagura Memory Cloud - Local Development
#
# Usage:
# docker compose up -d
#
# Access:
# API: http://localhost:8080
# Frontend: http://localhost:3000 (run separately: cd frontend && npm run dev)
# MCP: http://localhost:8080/mcp
services:
# ==========================================================================
# Database Services
# ==========================================================================
# PostgreSQL (Primary DB + Graph memory)
postgres:
image: postgres:15-alpine
container_name: kagura-postgres
environment:
POSTGRES_DB: kagura
POSTGRES_USER: kagura
POSTGRES_PASSWORD: ${DB_PASSWORD:-kagura_dev_password}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U kagura -d postgres"]
interval: 5s
timeout: 5s
retries: 5
start_period: 30s
# Qdrant (Vector DB)
qdrant:
image: qdrant/qdrant:v1.15.0
container_name: kagura-qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
healthcheck:
test: ["CMD-SHELL", "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Redis (Cache)
redis:
image: redis:7-alpine
container_name: kagura-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# Backend API
api:
build:
context: ./backend
dockerfile: Dockerfile
container_name: kagura-api
env_file:
- .env.local
environment:
# Database (local docker postgres - async driver)
DATABASE_URL: postgresql+asyncpg://kagura:${DB_PASSWORD:-kagura_dev_password}@postgres:5432/kagura
# Qdrant (Vector DB)
QDRANT_URL: http://qdrant:6333
# Redis (Cache)
REDIS_URL: redis://redis:6379
# OAuth2 - Let .env.local handle these
# GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET are read from .env.local
GOOGLE_REDIRECT_URI: http://localhost:8080/api/v1/auth/google/callback
# Security — values from .env.local (via env_file above)
# API_KEY_SECRET, JWT_SECRET are read from .env.local
JWT_ALGORITHM: "HS256"
JWT_EXPIRE_MINUTES: "60"
# API Settings
API_HOST: 0.0.0.0
API_PORT: 8080
LOG_LEVEL: ${LOG_LEVEL:-info}
LOG_COLORIZE: "true"
PYTHONUNBUFFERED: "1"
# CORS
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:3000,http://localhost:8080}
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
qdrant:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend/src:/app/src # Hot reload
- ./backend/tests:/app/tests
command: uvicorn src.api.main:app --host 0.0.0.0 --port 8080 --reload --log-level info --use-colors
# Frontend (Next.js dev server)
web:
image: node:20-alpine
container_name: kagura-web-dev
working_dir: /app
environment:
NEXT_PUBLIC_API_URL: http://localhost:8080
NEXT_TELEMETRY_DISABLED: "1"
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
command: sh -c "npm install && npx next dev --hostname 0.0.0.0"
depends_on:
- api
volumes:
postgres_data:
qdrant_data:
redis_data:
frontend_node_modules: