108 lines
2.8 KiB
YAML
108 lines
2.8 KiB
YAML
# BMAD Web - Docker Compose
|
|
# Development and production orchestration
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: bmad-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-bmad}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-bmad_dev_password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-bmad_web}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bmad}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis Cache
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: bmad-redis
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# API Backend
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.api
|
|
container_name: bmad-api
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: ${NODE_ENV:-development}
|
|
PORT: 4000
|
|
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
|
|
JWT_SECRET: ${JWT_SECRET:-dev-secret-change-in-production}
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-bmad}:${POSTGRES_PASSWORD:-bmad_dev_password}@postgres:5432/${POSTGRES_DB:-bmad_web}
|
|
REDIS_URL: redis://redis:6379
|
|
BMAD_ROOT: /app/bmad-src
|
|
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
|
|
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
|
|
ports:
|
|
- "4000:4000"
|
|
volumes:
|
|
# For development: hot reload
|
|
- ./apps/api/src:/app/src:ro
|
|
# BMAD source for agent definitions
|
|
- ../src:/app/bmad-src:ro
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:4000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Web Frontend
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.web
|
|
args:
|
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:4000}
|
|
NEXT_PUBLIC_WS_URL: ${NEXT_PUBLIC_WS_URL:-ws://localhost:4000}
|
|
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
|
|
container_name: bmad-web
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- api
|
|
environment:
|
|
NODE_ENV: ${NODE_ENV:-development}
|
|
PORT: 3000
|
|
ports:
|
|
- "3000:3000"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
|
|
networks:
|
|
default:
|
|
name: bmad-network
|