-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathdocker-compose.multi-tenant.yml
More file actions
113 lines (108 loc) · 3.39 KB
/
Copy pathdocker-compose.multi-tenant.yml
File metadata and controls
113 lines (108 loc) · 3.39 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
# Docker Compose for multi-tenant testing with subdomain routing
#
# Usage:
# docker compose -f docker-compose.multi-tenant.yml up
#
# Prerequisites:
# 1. Set SALES_AGENT_DOMAIN environment variable (e.g., sales-agent.local)
# 2. Add to /etc/hosts:
# 127.0.0.1 sales-agent.local
# 127.0.0.1 admin.sales-agent.local
# 127.0.0.1 tenant1.sales-agent.local
# 127.0.0.1 tenant2.sales-agent.local
#
# Access (assuming SALES_AGENT_DOMAIN=sales-agent.local):
# - http://admin.sales-agent.local:8000/ -> Admin UI
# - http://tenant1.sales-agent.local:8000/mcp -> Tenant 1 MCP
# - http://tenant1.sales-agent.local:8000/a2a -> Tenant 1 A2A
# - http://sales-agent.local:8000/ -> Main signup page
#
# Uses pre-built images from GitHub Container Registry.
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: adcp
POSTGRES_USER: adcp_user
POSTGRES_PASSWORD: secure_password_change_me
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U adcp_user -d adcp"]
interval: 10s
timeout: 5s
retries: 5
# Full nginx with subdomain routing
proxy:
image: nginx:stable
volumes:
# Use multi-tenant nginx config with Docker service names
- ./config/nginx/nginx-multi-tenant.conf:/etc/nginx/nginx.conf:ro
depends_on:
- adcp-server
- admin-ui
ports:
- "${PROXY_PORT:-8000}:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
adcp-server:
image: ghcr.io/prebid/salesagent:${IMAGE_TAG:-latest}
env_file:
- path: .env
required: false
- path: .env.secrets
required: false
environment:
DATABASE_URL: postgresql://adcp_user:secure_password_change_me@postgres:5432/adcp?sslmode=disable
SKIP_NGINX: "true"
SKIP_CRON: "true"
ADCP_SALES_PORT: "8080"
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
SUPER_ADMIN_EMAILS: ${SUPER_ADMIN_EMAILS:-}
ADCP_TESTING: ${ADCP_TESTING:-}
DELIVERY_WEBHOOK_INTERVAL: ${DELIVERY_WEBHOOK_INTERVAL:-}
depends_on:
postgres:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./audit_logs:/app/audit_logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
admin-ui:
image: ghcr.io/prebid/salesagent:${IMAGE_TAG:-latest}
command: python -m src.admin.server
env_file:
- path: .env
required: false
- path: .env.secrets
required: false
environment:
DATABASE_URL: postgresql://adcp_user:secure_password_change_me@postgres:5432/adcp?sslmode=disable
SKIP_NGINX: "true"
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
SUPER_ADMIN_EMAILS: ${SUPER_ADMIN_EMAILS:-}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
ADCP_AUTH_TEST_MODE: ${ADCP_AUTH_TEST_MODE:-true}
depends_on:
postgres:
condition: service_healthy
volumes:
- ./audit_logs:/app/audit_logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data: