dotb_ai-platform/compose.yaml
hungtran24 b1f6643796 refactor: score synchronously and drop webhook/background execution
POST /v1/lead-scoring/score now evaluates in the request, applies an overall
AI deadline, and stores the completed run only after scoring. Idempotency is
kept by (app_id, account_id, request_id) with a body fingerprint.

Removes the webhook outbox, scheduler/recovery loop, app lead_scoring
permission, credential audit events, seed_demo and generate_secret scripts,
and the tests that covered them. Trims tests to behavior of the new flow.
2026-10-09 02:44:24 +07:00

78 lines
2.5 KiB
YAML

name: ai-platform-local
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-ai_platform}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-local-change-this-password}
POSTGRES_DB: ${POSTGRES_DB:-ai_platform}
ports:
- "127.0.0.1:${POSTGRES_PORT:-55432}:5432"
volumes:
- ai_platform_pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 12
migrate:
build:
context: .
dockerfile: Dockerfile.backend
command: ["uv", "run", "--no-sync", "alembic", "upgrade", "head"]
environment:
AI_PLATFORM_DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-ai_platform}:${POSTGRES_PASSWORD:-local-change-this-password}@postgres:5432/${POSTGRES_DB:-ai_platform}
AI_PLATFORM_ENVIRONMENT: ${AI_PLATFORM_ENVIRONMENT:-development}
depends_on:
postgres:
condition: service_healthy
restart: "no"
backend:
build:
context: .
dockerfile: Dockerfile.backend
environment:
AI_PLATFORM_DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-ai_platform}:${POSTGRES_PASSWORD:-local-change-this-password}@postgres:5432/${POSTGRES_DB:-ai_platform}
AI_PLATFORM_ENVIRONMENT: ${AI_PLATFORM_ENVIRONMENT:-development}
AI_PLATFORM_AIHUB_BASE_URL: ${AI_PLATFORM_AIHUB_BASE_URL:-}
AI_PLATFORM_OPENAI_BASE_URL: ${AI_PLATFORM_OPENAI_BASE_URL:-}
AI_PLATFORM_OPENAI_API_KEY: ${AI_PLATFORM_OPENAI_API_KEY:-}
ports:
- "127.0.0.1:${BACKEND_PORT:-8000}:8000"
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health/ready', timeout=2)"]
interval: 10s
timeout: 3s
retries: 6
start_period: 10s
web:
build:
context: .
dockerfile: apps/web/Dockerfile
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
ORIGIN: ${WEB_ORIGIN:-http://localhost:3000}
BACKEND_INTERNAL_URL: http://backend:8000
WEB_ENVIRONMENT: ${WEB_ENVIRONMENT:-development}
LEAD_SCORING_FIXTURE_APP_API_KEY: ${LEAD_SCORING_FIXTURE_APP_API_KEY:-}
ports:
- "127.0.0.1:${WEB_PORT:-3000}:3000"
depends_on:
backend:
condition: service_healthy
volumes:
ai_platform_pgdata:
name: ai_platform_pgdata