-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
Β·137 lines (131 loc) Β· 3.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
Β·137 lines (131 loc) Β· 3.83 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
# Agent-OS Production Stack
# docker compose up -d
# docker compose logs -f agent-os
#
# REQUIRED: Set these environment variables before starting:
# export POSTGRES_PASSWORD="<strong-password>"
#
# Optional:
# export JWT_SECRET_KEY="<auto-generated if not set>"
# export AGENT_TOKEN="<your-agent-token>"
services:
# βββ PostgreSQL βββββββββββββββββββββββββββββββββββββββ
postgres:
image: postgres:16.6-alpine
container_name: agent-os-postgres
restart: unless-stopped
environment:
POSTGRES_USER: agent_os
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD env var}
POSTGRES_DB: agent_os
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U agent_os -d agent_os"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 512M
cpus: "1.0"
# βββ Redis βββββββββββββββββββββββββββββββββββββββββββ
redis:
image: redis:7.4-alpine
container_name: agent-os-redis
restart: unless-stopped
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes
volumes:
- redis-data:/data
ports:
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
deploy:
resources:
limits:
memory: 300M
cpus: "0.5"
# βββ Agent-OS ββββββββββββββββββββββββββββββββββββββββ
agent-os:
build: .
container_name: agent-os
restart: unless-stopped
security_opt:
- no-new-privileges:true
read_only: false
tmpfs:
- /tmp:noexec,nosuid,size=100m
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "127.0.0.1:8000:8000" # WebSocket
- "127.0.0.1:8001:8001" # HTTP REST API
environment:
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-}
- AGENT_TOKEN=${AGENT_TOKEN:-}
- AGENT_OS_HOST=0.0.0.0
- SWARM_ENABLED=${SWARM_ENABLED:-true}
- SWARM_MAX_WORKERS=${SWARM_MAX_WORKERS:-5}
- SWARM_ROUTER_THRESHOLD=${SWARM_ROUTER_THRESHOLD:-0.7}
- SWARM_LLM_ENABLED=${SWARM_LLM_ENABLED:-false}
- SWARM_LLM_API_KEY=${SWARM_LLM_API_KEY:-}
- SWARM_OUTPUT_FORMAT=${SWARM_OUTPUT_FORMAT:-json}
- SWARM_MAX_RESULTS=${SWARM_MAX_RESULTS:-10}
volumes:
- agent-os-data:/home/agentos/.agent-os
deploy:
resources:
limits:
memory: 2G
cpus: "2.0"
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
command: >
--port 8000
--database postgresql+asyncpg://agent_os:${POSTGRES_PASSWORD}@postgres:5432/agent_os
--redis redis://redis:6379/0
--json-logs
--create-tables
--swarm
# βββ Nginx Reverse Proxy (HTTP only, for local use) ββ
nginx:
image: nginx:1.27-alpine
container_name: agent-os-nginx
restart: unless-stopped
security_opt:
- no-new-privileges:true
depends_on:
- agent-os
ports:
- "127.0.0.1:8080:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
deploy:
resources:
limits:
memory: 128M
cpus: "0.5"
volumes:
postgres-data:
redis-data:
agent-os-data:
networks:
default:
driver: bridge
internal:
driver: bridge
internal: true # No external access