-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
170 lines (165 loc) · 4.47 KB
/
docker-compose.yml
File metadata and controls
170 lines (165 loc) · 4.47 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
services:
# PostgreSQL Database for LangGraph
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_DB=langgraph
- POSTGRES_USER=langgraph
- POSTGRES_PASSWORD=langgraph
- POSTGRES_INITDB_ARGS="--encoding=UTF8 --lc-collate=C --lc-ctype=C"
- POSTGRES_MAX_CONNECTIONS=200
- POSTGRES_SHARED_BUFFERS=256MB
- POSTGRES_EFFECTIVE_CACHE_SIZE=1GB
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
reservations:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U langgraph -d langgraph"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Redis for LangGraph task queue
redis:
image: redis:7-alpine
command: redis-server --appendonly yes --maxmemory 512M --maxmemory-policy allkeys-lru
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 256M
cpus: '0.25'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
# LangGraph Backend
langgraph-backend:
build:
context: ./examples/langgraph-backend
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- TAVILY_API_KEY=${TAVILY_API_KEY}
- LANGSMITH_API_KEY=${LANGSMITH_API_KEY}
- LANGGRAPH_DB_URL=postgresql://langgraph:langgraph@postgres:5432/langgraph
- REDIS_URL=redis://redis:6379
- ENVIRONMENT=production
- HOST=0.0.0.0
- PORT=8000
- LOG_LEVEL=info
- SECRET_KEY=${SECRET_KEY:-your-super-secret-jwt-key-change-in-production}
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES:-60}
volumes:
- ./examples/langgraph-backend:/app
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 2G
cpus: '2.0'
reservations:
memory: 1G
cpus: '1.0'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 15s
retries: 5
start_period: 60s
# SvelteKit Frontend
svelte-frontend:
build:
context: .
dockerfile: ./examples/dashboard/Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PUBLIC_LANGGRAPH_CHATBOT_URL=http://langgraph-backend:8000/chatbot
- PUBLIC_LANGGRAPH_CHATBOT_PERSISTENT_URL=http://langgraph-backend:8000/chatbot-persistent
- PUBLIC_LANGGRAPH_CODE_URL=http://langgraph-backend:8000/code-assistant
- PUBLIC_LANGGRAPH_DATA_URL=http://langgraph-backend:8000/data-analyst
- PUBLIC_LANGGRAPH_CREATIVE_URL=http://langgraph-backend:8000/creative-writer
- PUBLIC_LANGGRAPH_RESEARCH_URL=http://langgraph-backend:8000/research-assistant
- PUBLIC_SOCKET_IO_URL=http://localhost:3000
depends_on:
langgraph-backend:
condition: service_healthy
volumes:
- ./examples/dashboard:/app
- /app/node_modules
restart: unless-stopped
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
reservations:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Nginx reverse proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
depends_on:
svelte-frontend:
condition: service_healthy
langgraph-backend:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.25'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
volumes:
postgres_data:
redis_data: