-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
167 lines (148 loc) · 5.38 KB
/
docker-compose.production.yml
File metadata and controls
167 lines (148 loc) · 5.38 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
# ==========================================================================
# AgentGate Production Compose File (Pre-built Images)
# ==========================================================================
# Use this file for air-gapped or production deployments where images
# are pre-built and loaded via `docker load`.
#
# Usage:
# docker compose -f docker-compose.production.yml up -d
#
# See docs/deployment/air-gap.md for full deployment guide.
# ==========================================================================
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}
# Not exposed to host — only accessible within the internal network
expose:
- "5432"
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
# Not exposed to host — only accessible within the internal network
expose:
- "6379"
volumes:
- redis-data:/data
networks:
- agentgate-internal
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-changeme}
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-changeme}", "ping"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# ==========================================================================
# AgentGate Server (API) — Pre-built image, no build context
# ==========================================================================
server:
image: agentgate-server:latest
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:-changeme}@redis:6379
RATE_LIMIT_BACKEND: redis
# Security
ADMIN_API_KEY: ${ADMIN_API_KEY:?ADMIN_API_KEY is required}
JWT_SECRET: ${JWT_SECRET:-}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-*}
WEBHOOK_ENCRYPTION_KEY: ${WEBHOOK_ENCRYPTION_KEY:-}
# Decision links (set to internal hostname for air-gapped deployments)
DECISION_LINK_BASE_URL: ${DECISION_LINK_BASE_URL:-}
DASHBOARD_URL: ${DASHBOARD_URL:-}
# 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 — not available in air-gapped environments)
SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN:-}
SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET:-}
SLACK_DEFAULT_CHANNEL: ${SLACK_DEFAULT_CHANNEL:-}
# Discord (optional — not available in air-gapped environments)
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:-3000}: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) — Pre-built image, no build context
# ==========================================================================
dashboard:
image: agentgate-dashboard:latest
container_name: agentgate-dashboard
ports:
- "${DASHBOARD_PORT:-8080}: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
volumes:
postgres-data:
redis-data:
networks:
agentgate-internal:
driver: bridge