2026-02-25 17:22:30 +00:00
|
|
|
services:
|
|
|
|
|
ai-service:
|
|
|
|
|
build:
|
|
|
|
|
context: ./ai-service
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
container_name: ai-service
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
2026-02-25 17:46:24 +00:00
|
|
|
- "8182:8080"
|
2026-02-25 17:22:30 +00:00
|
|
|
environment:
|
|
|
|
|
- AI_SERVICE_DEBUG=false
|
|
|
|
|
- AI_SERVICE_LOG_LEVEL=INFO
|
|
|
|
|
- AI_SERVICE_DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/ai_service
|
|
|
|
|
- AI_SERVICE_QDRANT_URL=http://qdrant:6333
|
|
|
|
|
- AI_SERVICE_LLM_PROVIDER=${AI_SERVICE_LLM_PROVIDER:-openai}
|
|
|
|
|
- AI_SERVICE_LLM_API_KEY=${AI_SERVICE_LLM_API_KEY:-}
|
|
|
|
|
- AI_SERVICE_LLM_BASE_URL=${AI_SERVICE_LLM_BASE_URL:-https://api.openai.com/v1}
|
|
|
|
|
- AI_SERVICE_LLM_MODEL=${AI_SERVICE_LLM_MODEL:-gpt-4o-mini}
|
|
|
|
|
- AI_SERVICE_OLLAMA_BASE_URL=${AI_SERVICE_OLLAMA_BASE_URL:-http://ollama:11434}
|
2026-02-26 12:04:22 +00:00
|
|
|
volumes:
|
|
|
|
|
- ai_service_config:/app/config
|
2026-02-25 17:22:30 +00:00
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
qdrant:
|
|
|
|
|
condition: service_started
|
|
|
|
|
networks:
|
|
|
|
|
- ai-network
|
|
|
|
|
healthcheck:
|
2026-02-25 18:41:33 +00:00
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/ai/health"]
|
2026-02-25 17:22:30 +00:00
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 40s
|
|
|
|
|
|
|
|
|
|
ai-service-admin:
|
|
|
|
|
build:
|
|
|
|
|
context: ./ai-service-admin
|
|
|
|
|
dockerfile: Dockerfile
|
2026-02-25 19:11:36 +00:00
|
|
|
args:
|
|
|
|
|
VITE_APP_API_KEY: ${VITE_APP_API_KEY:-}
|
|
|
|
|
VITE_APP_BASE_API: /api
|
2026-02-25 17:22:30 +00:00
|
|
|
container_name: ai-service-admin
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
2026-02-25 17:42:43 +00:00
|
|
|
- "8181:80"
|
2026-02-25 17:22:30 +00:00
|
|
|
depends_on:
|
|
|
|
|
- ai-service
|
|
|
|
|
networks:
|
|
|
|
|
- ai-network
|
|
|
|
|
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:15-alpine
|
|
|
|
|
container_name: ai-postgres
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
environment:
|
|
|
|
|
- POSTGRES_USER=postgres
|
|
|
|
|
- POSTGRES_PASSWORD=postgres
|
|
|
|
|
- POSTGRES_DB=ai_service
|
|
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
|
- ./ai-service/scripts/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql:ro
|
|
|
|
|
ports:
|
|
|
|
|
- "5432:5432"
|
|
|
|
|
networks:
|
|
|
|
|
- ai-network
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d ai_service"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
|
|
qdrant:
|
|
|
|
|
image: qdrant/qdrant:latest
|
|
|
|
|
container_name: ai-qdrant
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "6333:6333"
|
|
|
|
|
- "6334:6334"
|
|
|
|
|
volumes:
|
|
|
|
|
- qdrant_data:/qdrant/storage
|
|
|
|
|
networks:
|
|
|
|
|
- ai-network
|
|
|
|
|
|
2026-02-25 17:28:08 +00:00
|
|
|
ollama:
|
|
|
|
|
image: ollama/ollama:latest
|
|
|
|
|
container_name: ai-ollama
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "11434:11434"
|
|
|
|
|
volumes:
|
|
|
|
|
- ollama_data:/root/.ollama
|
|
|
|
|
networks:
|
|
|
|
|
- ai-network
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
reservations:
|
|
|
|
|
memory: 1G
|
|
|
|
|
|
2026-02-25 17:22:30 +00:00
|
|
|
networks:
|
|
|
|
|
ai-network:
|
|
|
|
|
driver: bridge
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
|
|
|
|
qdrant_data:
|
2026-02-25 17:28:08 +00:00
|
|
|
ollama_data:
|
2026-02-26 12:04:22 +00:00
|
|
|
ai_service_config:
|