-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
177 lines (160 loc) · 5.57 KB
/
docker-compose.yml
File metadata and controls
177 lines (160 loc) · 5.57 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
171
172
173
174
175
176
177
version: '3.8'
services:
# ==========================================================================
# PostgreSQL Database
# ==========================================================================
postgres:
image: postgres:16-alpine
container_name: agentgate-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-agentgate}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-agentgate}
POSTGRES_DB: ${POSTGRES_DB:-agentgate}
# Ports not exposed to host by default for security.
# To expose for debugging, use: docker-compose -f docker-compose.yml -f docker-compose.override.yml up
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- agentgate-internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-agentgate} -d ${POSTGRES_DB:-agentgate}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# ==========================================================================
# Redis (for rate limiting, queues, pub/sub)
# ==========================================================================
redis:
image: redis:7-alpine
container_name: agentgate-redis
# Ports not exposed to host by default for security.
# To expose for debugging, use: docker-compose -f docker-compose.yml -f docker-compose.override.yml up
volumes:
- redis-data:/data
networks:
- agentgate-internal
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-agentgate}
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-agentgate}", "ping"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# ==========================================================================
# AgentGate Server (API)
# ==========================================================================
server:
build:
context: .
dockerfile: packages/server/Dockerfile
container_name: agentgate-server
environment:
# Server
PORT: 3000
HOST: 0.0.0.0
NODE_ENV: ${NODE_ENV:-production}
# Database (PostgreSQL)
DB_DIALECT: postgres
DATABASE_URL: postgresql://${POSTGRES_USER:-agentgate}:${POSTGRES_PASSWORD:-agentgate}@postgres:5432/${POSTGRES_DB:-agentgate}
# Redis
REDIS_URL: redis://:${REDIS_PASSWORD:-agentgate}@redis:6379
RATE_LIMIT_BACKEND: redis
# Security
ADMIN_API_KEY: ${ADMIN_API_KEY:?ADMIN_API_KEY is required}
JWT_SECRET: ${JWT_SECRET:-}
CORS_ORIGINS: ${CORS_ORIGINS:-*}
# Rate Limiting
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
RATE_LIMIT_RPM: ${RATE_LIMIT_RPM:-60}
# Timeouts
REQUEST_TIMEOUT_SEC: ${REQUEST_TIMEOUT_SEC:-3600}
WEBHOOK_TIMEOUT_MS: ${WEBHOOK_TIMEOUT_MS:-5000}
WEBHOOK_MAX_RETRIES: ${WEBHOOK_MAX_RETRIES:-3}
# Logging
LOG_LEVEL: ${LOG_LEVEL:-info}
LOG_FORMAT: ${LOG_FORMAT:-json}
# Slack (optional)
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN:-}
SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET:-}
SLACK_DEFAULT_CHANNEL: ${SLACK_DEFAULT_CHANNEL:-}
# Discord (optional)
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN:-}
DISCORD_DEFAULT_CHANNEL: ${DISCORD_DEFAULT_CHANNEL:-}
# Email (optional)
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASS: ${SMTP_PASS:-}
SMTP_FROM: ${SMTP_FROM:-}
# Channel routing
CHANNEL_ROUTES: ${CHANNEL_ROUTES:-[]}
ports:
- "${SERVER_PORT:-3002}:3000"
networks:
- agentgate-internal
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
restart: unless-stopped
# ==========================================================================
# AgentGate Dashboard (Web UI)
# ==========================================================================
dashboard:
build:
context: .
dockerfile: packages/dashboard/Dockerfile
container_name: agentgate-dashboard
ports:
- "${DASHBOARD_PORT:-3003}:80"
networks:
- agentgate-internal
depends_on:
server:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 5s
start_period: 5s
retries: 3
restart: unless-stopped
# ==========================================================================
# Slack Bot (optional)
# ==========================================================================
slack-bot:
build:
context: .
dockerfile: packages/slack/Dockerfile
container_name: agentgate-slack
profiles:
- bots
environment:
AGENTGATE_URL: http://server:3000
AGENTGATE_API_KEY: ${ADMIN_API_KEY:?ADMIN_API_KEY is required}
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN:?SLACK_BOT_TOKEN is required for slack-bot}
SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET:?SLACK_SIGNING_SECRET is required for slack-bot}
SLACK_APP_TOKEN: ${SLACK_APP_TOKEN:-}
PORT: 3001
ports:
- "${SLACK_BOT_PORT:-3004}:3001"
networks:
- agentgate-internal
depends_on:
server:
condition: service_healthy
restart: unless-stopped
volumes:
postgres-data:
redis-data:
networks:
agentgate-internal:
driver: bridge