Add P1/P2 to docker-compose, mount all 6 migration dirs, add P2 agent Dockerfile

- route-api (3001), route-proxy (8080), route-worker as separate services
- drift SaaS (3002) added
- All 6 product migrations mounted into postgres init
- docker-init-db.sh creates all 6 databases
This commit is contained in:
2026-03-01 06:11:20 +00:00
parent 5e0065e73e
commit 64213c39e9
2 changed files with 69 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ services:
volumes:
- pg_data:/var/lib/postgresql/data
- ./docker-init-db.sh:/docker-entrypoint-initdb.d/01-init-db.sh:ro
- ./01-llm-cost-router/migrations:/migrations/01-route:ro
- ./02-iac-drift-detection/saas/migrations:/migrations/02-drift:ro
- ./03-alert-intelligence/migrations:/migrations/03-alert:ro
- ./04-lightweight-idp/migrations:/migrations/04-portal:ro
- ./05-aws-cost-anomaly/migrations:/migrations/05-cost:ro
@@ -46,6 +48,71 @@ services:
- meili_data:/meili_data
# --- dd0c Products ---
# P1: LLM Cost Router (Rust — API server)
route-api:
build:
context: ./01-llm-cost-router
dockerfile: Dockerfile
command: ["dd0c-api"]
ports:
- "3001:3000"
environment:
PORT: "3000"
DATABASE_URL: postgresql://dd0c:dd0c-dev@postgres:5432/dd0c_route
REDIS_URL: redis://redis:6379
JWT_SECRET: dev-secret-change-me-in-production!!
LOG_LEVEL: info
depends_on:
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
# P1: LLM Cost Router (Rust — proxy)
route-proxy:
build:
context: ./01-llm-cost-router
dockerfile: Dockerfile
command: ["dd0c-proxy"]
ports:
- "8080:8080"
environment:
DATABASE_URL: postgresql://dd0c:dd0c-dev@postgres:5432/dd0c_route
REDIS_URL: redis://redis:6379
LOG_LEVEL: info
depends_on:
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
# P1: LLM Cost Router (Rust — worker)
route-worker:
build:
context: ./01-llm-cost-router
dockerfile: Dockerfile
command: ["dd0c-worker"]
environment:
DATABASE_URL: postgresql://dd0c:dd0c-dev@postgres:5432/dd0c_route
REDIS_URL: redis://redis:6379
LOG_LEVEL: info
depends_on:
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
# P2: IaC Drift Detection (SaaS)
drift:
build:
context: ./02-iac-drift-detection/saas
dockerfile: Dockerfile
ports:
- "3002:3000"
environment:
PORT: "3000"
DATABASE_URL: postgresql://dd0c:dd0c-dev@postgres:5432/dd0c_drift
REDIS_URL: redis://redis:6379
JWT_SECRET: dev-secret-change-me-in-production!!
LOG_LEVEL: info
depends_on:
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
# P3: Alert Intelligence
alert:
build:

View File

@@ -20,6 +20,8 @@ run_migrations() {
fi
}
run_migrations dd0c_route /migrations/01-route
run_migrations dd0c_drift /migrations/02-drift
run_migrations dd0c_alert /migrations/03-alert
run_migrations dd0c_portal /migrations/04-portal
run_migrations dd0c_cost /migrations/05-cost