mirror of
https://github.com/furyhawk/agent_delta.git
synced 2026-07-20 09:45:36 +00:00
195 lines
5.6 KiB
YAML
195 lines
5.6 KiB
YAML
|
|
# Development configuration (alias for docker-compose.yml)
|
|
# Usage: docker-compose -f docker-compose.dev.yml up -d
|
|
#
|
|
# This file is identical to docker-compose.yml for explicit naming preference.
|
|
# Use docker-compose.yml for default development.
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
image: agent_delta_backend:dev
|
|
container_name: agent_delta_backend
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./backend/app:/app/app:ro
|
|
- ./backend/cli:/app/cli:ro
|
|
- media_data:/app/media
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
- DEBUG=true
|
|
- ENVIRONMENT=local
|
|
- POSTGRES_HOST=db
|
|
- REDIS_HOST=redis
|
|
- QDRANT_HOST=qdrant
|
|
- QDRANT_PORT=6333
|
|
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
|
networks:
|
|
- backend
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
qdrant:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: agent_delta_db
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
|
|
- POSTGRES_DB=${POSTGRES_DB:-agent_delta}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- backend
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: agent_delta_redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- backend
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
qdrant:
|
|
image: qdrant/qdrant:v1.18.1
|
|
container_name: agent_delta_qdrant
|
|
ports:
|
|
- "6333:6333"
|
|
- "6334:6334"
|
|
volumes:
|
|
- qdrant_data:/qdrant/storage
|
|
networks:
|
|
- backend
|
|
healthcheck:
|
|
test: bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
taskiq_worker:
|
|
image: agent_delta_backend:dev
|
|
pull_policy: never
|
|
container_name: agent_delta_taskiq_worker
|
|
volumes:
|
|
- ./backend/app:/app/app:ro
|
|
- media_data:/app/media
|
|
command: taskiq worker app.worker.taskiq_app:broker --workers 1 --reload
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
- DEBUG=true
|
|
- POSTGRES_HOST=db
|
|
- REDIS_HOST=redis
|
|
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
networks:
|
|
- backend
|
|
depends_on:
|
|
app:
|
|
condition: service_started
|
|
redis:
|
|
condition: service_healthy
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
taskiq_scheduler:
|
|
image: agent_delta_backend:dev
|
|
pull_policy: never
|
|
container_name: agent_delta_taskiq_scheduler
|
|
volumes:
|
|
- ./backend/app:/app/app:ro
|
|
command: taskiq scheduler app.worker.taskiq_app:scheduler
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
- DEBUG=true
|
|
- REDIS_HOST=redis
|
|
- TASKIQ_BROKER_URL=redis://redis:6379/1
|
|
- TASKIQ_RESULT_BACKEND=redis://redis:6379/1
|
|
networks:
|
|
- backend
|
|
depends_on:
|
|
app:
|
|
condition: service_started
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# AntV mcp-server-chart sidecar: advanced diagram tools over MCP. Opt-in —
|
|
# starts only with the "antv" profile; the agent connects when ENABLE_ANTV_CHARTS=true.
|
|
antvis-chart:
|
|
image: node:20-alpine
|
|
container_name: agent_delta_antvis_chart
|
|
profiles: ["antv"]
|
|
command: >
|
|
npx -y @antv/mcp-server-chart
|
|
--transport streamable --host 0.0.0.0 --port 1122 --endpoint /mcp
|
|
environment:
|
|
# Empty = AntV's public rendering backend. Point at a self-hosted
|
|
# GPT-Vis-SSR for private deployments (data never leaves your infra).
|
|
- VIS_REQUEST_SERVER=${ANTV_VIS_REQUEST_SERVER:-}
|
|
# Default drops basic charts (covered by create_chart/Recharts) and the
|
|
# China-only map tools (covered by create_map/Leaflet). Override via ANTV_DISABLED_TOOLS.
|
|
- DISABLED_TOOLS=${ANTV_DISABLED_TOOLS:-generate_area_chart,generate_bar_chart,generate_column_chart,generate_line_chart,generate_pie_chart,generate_scatter_chart,generate_district_map,generate_pin_map,generate_path_map}
|
|
# Dev only: publish the MCP/render port to the host for debugging. The
|
|
# backend reaches the sidecar over the internal network, so the prod
|
|
# compose omits this (avoids exposing an unauthenticated endpoint).
|
|
ports:
|
|
- "1122:1122"
|
|
networks:
|
|
- backend
|
|
healthcheck:
|
|
# The MCP streamable-HTTP endpoint rejects a plain GET, so a bare `wget`
|
|
# would report the container unhealthy even while it serves fine. Use node
|
|
# (always present in this image) and treat ANY HTTP response — including a
|
|
# 4xx — as "process is up"; only a connection error counts as a failure.
|
|
test:
|
|
- "CMD"
|
|
- "node"
|
|
- "-e"
|
|
- "require('http').get('http://localhost:1122/mcp',r=>process.exit(0)).on('error',()=>process.exit(1))"
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 20s
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
backend:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
media_data:
|
|
postgres_data:
|
|
redis_data:
|
|
qdrant_data:
|