msyql 容器化, aichatservice 容器化

This commit is contained in:
1iaan
2026-04-05 17:49:10 +08:00
parent 9d7c416737
commit f433490e0d
9 changed files with 133 additions and 208 deletions

View File

@@ -1,4 +1,23 @@
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
# ports:
# - "3306:3306"
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
@@ -49,24 +68,40 @@ services:
- "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
volumes:
- /home/lian/share/aichat/ai-chat-service/docker.config.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
chatgpt-web-backend:
build:
context: ./ai-chat-backend
image: ai-chat-backend:1.0.0
container_name: chatgpt-web-backend
# 容器内端口7080
environment:
SERVER_HOST: 0.0.0.0
SERVER_PORT: 7080
FRONTEND_PATH: www
OPENAI_MODEL: ${OPENAI_MODEL}
OPENAI_TEMPERATURE: "${OPENAI_TEMPERATURE}"
OPENAI_PRESENCE_PENALTY: "${OPENAI_PRESENCE_PENALTY}"
OPENAI_FREQUENCY_PENALTY: "${OPENAI_FREQUENCY_PENALTY}"
AI_CHAT_SERVICE_ADDRESS: ${AI_CHAT_SERVICE_ADDRESS:-host.docker.internal:50055}
AI_CHAT_SERVICE_ACCESS_TOKEN: ${AI_CHAT_SERVICE_ACCESS_TOKEN:-me256487ang1chubdpdialoud22sev1ozhoguumyqca}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- /home/lian/share/aichat/ai-chat-backend/docker.config.yaml:/app/config.yaml:ro
depends_on:
- ai-chat-service
restart: unless-stopped
chatgpt-web-frontend: