-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.original-dev.yml
More file actions
166 lines (162 loc) · 6 KB
/
docker-compose.original-dev.yml
File metadata and controls
166 lines (162 loc) · 6 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
# =============================================================================
# Busibox Development Mode - Next.js Applications
# =============================================================================
#
# Development overlay for Next.js apps with:
# - Volume-mounted source code for live editing
# - busibox-app mounted at /app/.busibox-app and symlinked into node_modules
# - Turbopack hot-reload with full busibox-app support
#
# Prerequisites:
# - Build busibox-app on host: cd ../busibox-app && npm run build
# - Set GITHUB_AUTH_TOKEN in .env.local
#
# Usage:
# docker compose -f docker-compose.local.yml -f docker-compose.dev.yml up
# Or: make docker-up ENV=development
#
# How busibox-app linking works:
# 1. busibox-app is mounted at /app/.busibox-app (inside project for Turbopack)
# 2. dev-entrypoint.sh creates symlink: node_modules/@jazzmind/busibox-app -> /app/.busibox-app
# 3. next.config.ts has transpilePackages: ['@jazzmind/busibox-app']
#
# See docs/development/docker-dev-mode.md for full documentation.
#
# =============================================================================
services:
# Busibox Portal - Main Frontend (Development Mode)
busibox-portal:
build:
context: ../busibox-portal
dockerfile: Dockerfile.dev
args:
GITHUB_AUTH_TOKEN: ${GITHUB_AUTH_TOKEN:-}
container_name: local-busibox-portal
hostname: busibox-portal
restart: unless-stopped
environment:
NODE_ENV: development
PORT: 3000
# Database
DATABASE_URL: postgresql://${POSTGRES_USER:-busibox_user}:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}@postgres:5432/ai_portal
# Auth - use https://localhost for SSL
BETTER_AUTH_URL: https://localhost/portal
# Email (optional - uses console logging in dev)
RESEND_API_KEY: ${RESEND_API_KEY:-}
EMAIL_FROM: ${EMAIL_FROM:-noreply@localhost}
# Admin
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@localhost}
ALLOWED_EMAIL_DOMAINS: ${ALLOWED_EMAIL_DOMAINS:-*}
# AuthZ - use internal container URLs
AUTHZ_BASE_URL: http://authz-api:8010
# LiteLLM
LITELLM_BASE_URL: http://litellm:4000/v1
LITELLM_API_KEY: ${LITELLM_API_KEY:?LITELLM_API_KEY must be set}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
# SSO
SSO_JWT_SECRET: ${SSO_JWT_SECRET:?SSO_JWT_SECRET must be set}
# Service URLs (for SSO redirect via nginx proxy)
NEXT_PUBLIC_BUSIBOX_AGENTS_URL: https://localhost/agents
NEXT_PUBLIC_APP_URL: https://localhost/portal
# Base path for nginx subpath routing
NEXT_PUBLIC_BASE_PATH: /portal
# Backend service URLs (for server-side API calls)
# Note: AGENT_API_URL overrides any .env file setting
AGENT_API_URL: http://agent-api:8000
DATA_API_HOST: data-api
DATA_API_PORT: "8002"
SEARCH_API_HOST: search-api
SEARCH_API_PORT: "8003"
AGENT_API_HOST: agent-api
AGENT_API_PORT: "8000"
# Docs API - internal container URL for server-side fetching
DOCS_API_URL: http://docs-api:8004
ports:
- "3000:3000"
volumes:
# Mount source code for live editing
- ../busibox-portal:/app
# Preserve node_modules from container (installed during build)
- busibox-portal-node-modules:/app/node_modules
# Preserve .next build cache
- busibox-portal-next-cache:/app/.next
# Mount busibox-app INSIDE /app so outputFileTracingRoot works
- ../busibox-app:/app/.busibox-app:ro
depends_on:
postgres:
condition: service_healthy
authz-api:
condition: service_healthy
docs-api:
condition: service_healthy
healthcheck:
# Note: basePath is /portal, so health is at /portal/api/health
test: ["CMD", "curl", "-f", "http://localhost:3000/portal/api/health"]
interval: 30s
timeout: 10s
start_period: 120s
retries: 5
networks:
- busibox-net
# Agent Manager - Agent Management UI (Development Mode)
busibox-agents:
build:
context: ../busibox-agents
dockerfile: Dockerfile.dev
args:
GITHUB_AUTH_TOKEN: ${GITHUB_AUTH_TOKEN:-}
container_name: local-busibox-agents
hostname: busibox-agents
restart: unless-stopped
environment:
NODE_ENV: development
PORT: 3001
# API URLs - use nginx proxy paths for CORS compliance
NEXT_PUBLIC_AGENT_API_URL: https://localhost/api/agent
NEXT_PUBLIC_DATA_API_URL: https://localhost/api/data
NEXT_PUBLIC_SEARCH_API_URL: https://localhost/api/search
# Busibox Portal (SSO) via nginx
NEXT_PUBLIC_BUSIBOX_PORTAL_URL: https://localhost/portal
# AuthZ - internal container URL
AUTHZ_BASE_URL: http://authz-api:8010
# Base path for nginx subpath routing
NEXT_PUBLIC_BASE_PATH: /agents
NEXT_PUBLIC_APP_URL: https://localhost/agents
# Backend service URLs (for server-side API calls)
AGENT_API_HOST: agent-api
AGENT_API_PORT: "8000"
ports:
- "3001:3001"
volumes:
# Mount source code for live editing
- ../busibox-agents:/app
# Preserve node_modules from container (installed during build)
- busibox-agents-node-modules:/app/node_modules
# Preserve .next build cache
- busibox-agents-next-cache:/app/.next
# Mount busibox-app INSIDE /app so outputFileTracingRoot works
- ../busibox-app:/app/.busibox-app:ro
depends_on:
authz-api:
condition: service_healthy
healthcheck:
# Note: basePath is /agents, so check the base path
test: ["CMD", "curl", "-f", "http://localhost:3001/agents"]
interval: 30s
timeout: 10s
start_period: 120s
retries: 5
networks:
- busibox-net
# Named volumes for node_modules and .next cache
# These preserve installed dependencies across container restarts
volumes:
busibox-portal-node-modules:
busibox-portal-next-cache:
busibox-agents-node-modules:
busibox-agents-next-cache:
# Use the same network as the base compose
networks:
busibox-net:
external: true
name: busibox-local