Files
kefu/deploy/im-admin/compose.yaml
T
2026-09-21 10:34:06 +08:00

91 lines
2.1 KiB
YAML

name: im-admin
x-common: &common
image: zyt/wecom-admin:current
build:
context: ../..
dockerfile: deploy/im-admin/Dockerfile
restart: unless-stopped
environment:
PYTHONDONTWRITEBYTECODE: "1"
PYTHONUNBUFFERED: "1"
KNOWLEDGE_QDRANT_URL: "${KNOWLEDGE_QDRANT_URL:-}"
KNOWLEDGE_QDRANT_KEY: "${KNOWLEDGE_QDRANT_KEY:-}"
KNOWLEDGE_EMBEDDING_URL: "${KNOWLEDGE_EMBEDDING_URL:-}"
KNOWLEDGE_EMBEDDING_MODEL: "${KNOWLEDGE_EMBEDDING_MODEL:-}"
KNOWLEDGE_EMBEDDING_KEY: "${KNOWLEDGE_EMBEDDING_KEY:-}"
ZYT_API_BASE_URL: "${ZYT_API_BASE_URL:-https://admin.zhenyangtang.com.cn}"
volumes:
- ./data:/data
read_only: true
tmpfs:
- /tmp:size=64m,mode=1777
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 20s
services:
api:
<<: *common
command:
- python
- admin_api.py
- --db
- /data/backend.db
- --host
- 0.0.0.0
- --port
- "8766"
- --runtime-file
- /data/backend_runtime.json
- --zyt-api-url
- "${ZYT_API_BASE_URL:-https://admin.zhenyangtang.com.cn}"
ports:
- "127.0.0.1:18766:8766"
healthcheck:
test:
- CMD
- python
- -c
- import urllib.request; urllib.request.urlopen('http://127.0.0.1:8766/api/v2/health', timeout=3).read()
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
gateway:
<<: *common
command:
- python
- model_gateway.py
- --db
- /data/backend.db
- --host
- 0.0.0.0
- --port
- "8770"
ports:
- "127.0.0.1:18770:8770"
depends_on:
api:
condition: service_healthy
healthcheck:
test:
- CMD
- python
- -c
- import urllib.request; urllib.request.urlopen('http://127.0.0.1:8770/health', timeout=3).read()
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
knowledge-worker:
<<: *common
command: ["python", "knowledge_worker.py", "--db", "/data/backend.db"]
depends_on:
api:
condition: service_healthy