-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
129 lines (122 loc) · 4.78 KB
/
docker-compose.yml
File metadata and controls
129 lines (122 loc) · 4.78 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
# Smart Commerce Agent — Docker Compose (Phase 7)
# 4-core services: postgres, redis, commerce-api, agent-core
# Langfuse moved to separate file (optional — high memory usage)
version: '3.9'
services:
# ─────────────────────────────────────────────────────────
# Database (PostgreSQL 16 + pgvector)
# ─────────────────────────────────────────────────────────
postgres:
image: pgvector/pgvector:pg16
container_name: smart-commerce-postgres
environment:
POSTGRES_DB: smart_commerce
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./prisma/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d smart_commerce"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
# ─────────────────────────────────────────────────────────
# Cache & Checkpoints (Redis)
# ─────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
container_name: smart-commerce-redis
ports:
- "6379:6379"
command: >
redis-server
--appendonly yes
--maxmemory 128mb
--maxmemory-policy allkeys-lru
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
# ─────────────────────────────────────────────────────────
# Commerce API (Node.js + Hono + GraphQL + MCP)
# ─────────────────────────────────────────────────────────
commerce-api:
build:
context: .
dockerfile: apps/commerce-api/Dockerfile
container_name: smart-commerce-commerce-api
ports:
- "3001:3001"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/smart_commerce
REDIS_URL: redis://redis:6379
JWT_SECRET: ${JWT_SECRET}
OPENAI_API_KEY: ${OPENAI_API_KEY}
OPENAI_BASE_URL: ${OPENAI_BASE_URL}
OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o}
OPENAI_API_VERSION: ${OPENAI_API_VERSION:-2024-10-21}
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-text-embedding-3-small}
NODE_ENV: production
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3001/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
# ─────────────────────────────────────────────────────────
# Agent Core (Python + FastAPI + LangGraph)
# ─────────────────────────────────────────────────────────
agent-core:
build:
context: .
dockerfile: apps/agent-core/Dockerfile
container_name: smart-commerce-agent-core
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/smart_commerce
REDIS_URL: redis://redis:6379
COMMERCE_API_URL: http://commerce-api:3001
JWT_SECRET: ${JWT_SECRET}
OPENAI_API_KEY: ${OPENAI_API_KEY}
OPENAI_BASE_URL: ${OPENAI_BASE_URL}
OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4o}
OPENAI_API_VERSION: ${OPENAI_API_VERSION:-2024-10-21}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
commerce-api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 25s
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
volumes:
postgres_data:
external: true
name: vercel-ai-sdk_postgres_data