it0/deploy/docker/docker-compose.yml

279 lines
6.8 KiB
YAML

services:
# ===== Infrastructure =====
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-it0}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-it0_dev}
POSTGRES_DB: ${POSTGRES_DB:-it0}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-it0}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- it0-network
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- it0-network
# ===== API Gateway =====
api-gateway:
build:
context: ../../packages/gateway
ports:
- "8000:8000"
- "8001:8001"
depends_on:
auth-service:
condition: service_started
agent-service:
condition: service_started
ops-service:
condition: service_started
inventory-service:
condition: service_started
monitor-service:
condition: service_started
comm-service:
condition: service_started
audit-service:
condition: service_started
healthcheck:
test: ["CMD", "kong", "health"]
interval: 10s
timeout: 5s
retries: 3
networks:
- it0-network
# ===== Backend Services (shared Dockerfile.service) =====
auth-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: auth-service
SERVICE_PORT: 3001
ports:
- "3001:3001"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- JWT_SECRET=${JWT_SECRET:-dev-jwt-secret}
- JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET:-dev-jwt-refresh-secret}
- AUTH_SERVICE_PORT=3001
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- it0-network
agent-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: agent-service
SERVICE_PORT: 3002
ports:
- "3002:3002"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- AGENT_ENGINE_TYPE=claude_code_cli
- AGENT_SERVICE_PORT=3002
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- it0-network
ops-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: ops-service
SERVICE_PORT: 3003
ports:
- "3003:3003"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- OPS_SERVICE_PORT=3003
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- it0-network
inventory-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: inventory-service
SERVICE_PORT: 3004
ports:
- "3004:3004"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- VAULT_MASTER_KEY=${VAULT_MASTER_KEY:-dev-vault-key}
- INVENTORY_SERVICE_PORT=3004
depends_on:
postgres:
condition: service_healthy
networks:
- it0-network
monitor-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: monitor-service
SERVICE_PORT: 3005
ports:
- "3005:3005"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- MONITOR_SERVICE_PORT=3005
depends_on:
postgres:
condition: service_healthy
networks:
- it0-network
comm-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: comm-service
SERVICE_PORT: 3006
ports:
- "3006:3006"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- TWILIO_ACCOUNT_SID=${TWILIO_ACCOUNT_SID}
- TWILIO_AUTH_TOKEN=${TWILIO_AUTH_TOKEN}
- TWILIO_PHONE_NUMBER=${TWILIO_PHONE_NUMBER}
- COMM_SERVICE_PORT=3006
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- it0-network
audit-service:
build:
context: ../..
dockerfile: Dockerfile.service
args:
SERVICE_NAME: audit-service
SERVICE_PORT: 3007
ports:
- "3007:3007"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_USERNAME=${POSTGRES_USER:-it0}
- DB_PASSWORD=${POSTGRES_PASSWORD:-it0_dev}
- DB_DATABASE=${POSTGRES_DB:-it0}
- REDIS_URL=redis://redis:6379
- AUDIT_SERVICE_PORT=3007
depends_on:
postgres:
condition: service_healthy
networks:
- it0-network
voice-service:
build:
context: ../../packages/services/voice-service
ports:
- "3008:3008"
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- AGENT_SERVICE_URL=http://agent-service:3002
- WHISPER_MODEL=${WHISPER_MODEL:-large-v3}
- KOKORO_MODEL=${KOKORO_MODEL:-kokoro-82m}
- DEVICE=${VOICE_DEVICE:-cpu}
depends_on:
- agent-service
networks:
- it0-network
# ===== Frontend =====
web-admin:
build:
context: ../../it0-web-admin
ports:
- "3000:3000"
environment:
- API_BASE_URL=http://api-gateway:8000
- NEXT_PUBLIC_API_BASE_URL=/api/proxy
- NEXT_PUBLIC_WS_URL=ws://localhost:8000
depends_on:
- api-gateway
networks:
- it0-network
volumes:
postgres_data:
networks:
it0-network:
driver: bridge