121 lines
2.9 KiB
YAML
121 lines
2.9 KiB
YAML
services:
|
|
mysql:
|
|
image: mysql:8.0
|
|
container_name: ai-chat-mysql
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
command:
|
|
- --default-authentication-plugin=mysql_native_password
|
|
volumes:
|
|
- /data/mysql:/var/lib/mysql
|
|
- /home/lian/share/aichat/init/create_db.sql:/docker-entrypoint-initdb.d/create_db.sql:ro
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-proot"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
pgvector:
|
|
image: pgvector/pgvector:pg16
|
|
container_name: ai-chat-pgvector
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ai_chat
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- "15432:5432"
|
|
volumes:
|
|
- /data/pgvector:/var/lib/postgresql/data
|
|
- /home/lian/share/aichat/init/pgvector-init.sql:/docker-entrypoint-initdb.d/pgvector-init.sql:ro
|
|
|
|
tokenizer:
|
|
build:
|
|
context: ../tokenizer
|
|
image: tokenizer:1.0.0
|
|
container_name: tokenizer
|
|
ports:
|
|
- "3002:3002"
|
|
restart: unless-stopped
|
|
|
|
sensitive-filter:
|
|
build:
|
|
context: ../keywords-filter
|
|
image: keywords-filter:1.0.0
|
|
container_name: sensitive-filter
|
|
volumes:
|
|
- ./configs/sensitive.yaml:/app/config.yaml:ro
|
|
- ./configs/sensitive-dict.txt:/app/dict.txt:ro
|
|
command:
|
|
- --config=/app/config.yaml
|
|
- --dict=/app/dict.txt
|
|
ports:
|
|
- "50053:50053"
|
|
restart: unless-stopped
|
|
|
|
keywords-filter:
|
|
build:
|
|
context: ../keywords-filter
|
|
image: keywords-filter:1.0.0
|
|
container_name: keywords-filter
|
|
volumes:
|
|
- ./configs/keywords.yaml:/app/config.yaml:ro
|
|
- ./configs/keywords-dict.txt:/app/dict.txt:ro
|
|
command:
|
|
- --config=/app/config.yaml
|
|
- --dict=/app/dict.txt
|
|
ports:
|
|
- "50054:50054"
|
|
restart: unless-stopped
|
|
|
|
ai-chat-service:
|
|
build:
|
|
context: ../ai-chat-service
|
|
image: ai-chat-service:1.0.0
|
|
container_name: ai-chat-service
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./configs/ai-chat-service.yaml:/app/config.yaml:ro
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
ports:
|
|
- "50055:50055"
|
|
depends_on:
|
|
- mysql
|
|
- tokenizer
|
|
- sensitive-filter
|
|
- keywords-filter
|
|
- pgvector
|
|
healthcheck:
|
|
test: ["CMD", "grpc_health_probe", "-addr=:50055"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
ai-chat-backend:
|
|
build:
|
|
context: ../ai-chat-backend
|
|
image: ai-chat-backend:1.0.0
|
|
container_name: ai-chat-backend
|
|
ports:
|
|
- "7080:7080"
|
|
volumes:
|
|
- ./configs/ai-chat-backend.yaml:/app/config.yaml:ro
|
|
depends_on:
|
|
- ai-chat-service
|
|
restart: unless-stopped
|
|
|
|
ai-chat-web:
|
|
build:
|
|
context: ../ai-chat-web
|
|
image: ai-chat-web:1.0.0
|
|
container_name: ai-chat-web
|
|
depends_on:
|
|
- ai-chat-backend
|
|
ports:
|
|
- "${FRONTEND_PORT:-1025}:80"
|
|
restart: unless-stopped
|