199 lines
6.3 KiB
Plaintext
199 lines
6.3 KiB
Plaintext
services:
|
|
app:
|
|
image: wechatopenai/weknora-app:latest
|
|
container_name: WeKnora-app
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- data-files:/data/files
|
|
- ./config:/app/config
|
|
environment:
|
|
- GIN_MODE=${GIN_MODE}
|
|
- DB_DRIVER=postgres
|
|
- DB_HOST=postgres
|
|
- DB_PORT=5432
|
|
- DB_USER=${DB_USER}
|
|
- DB_PASSWORD=${DB_PASSWORD}
|
|
- DB_NAME=${DB_NAME}
|
|
- TZ=Asia/Shanghai
|
|
- OTEL_EXPORTER_OTLP_ENDPOINT=jaeger:4317
|
|
- OTEL_SERVICE_NAME=WeKnora
|
|
- OTEL_TRACES_EXPORTER=otlp
|
|
- OTEL_METRICS_EXPORTER=none
|
|
- OTEL_LOGS_EXPORTER=none
|
|
- OTEL_PROPAGATORS=tracecontext,baggage
|
|
- RETRIEVE_DRIVER=${RETRIEVE_DRIVER}
|
|
- ELASTICSEARCH_ADDR=${ELASTICSEARCH_ADDR}
|
|
- ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME}
|
|
- ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD}
|
|
- ELASTICSEARCH_INDEX=${ELASTICSEARCH_INDEX}
|
|
- DOCREADER_ADDR=docreader:50051
|
|
- STORAGE_TYPE=${STORAGE_TYPE}
|
|
- LOCAL_STORAGE_BASE_DIR=${LOCAL_STORAGE_BASE_DIR}
|
|
- MINIO_ENDPOINT=minio:9000
|
|
- MINIO_ACCESS_KEY_ID=${MINIO_ACCESS_KEY_ID:-minioadmin}
|
|
- MINIO_SECRET_ACCESS_KEY=${MINIO_SECRET_ACCESS_KEY:-minioadmin}
|
|
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
|
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
|
|
- STREAM_MANAGER_TYPE=${STREAM_MANAGER_TYPE}
|
|
- REDIS_ADDR=redis:6379
|
|
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
|
- REDIS_DB=${REDIS_DB}
|
|
- REDIS_PREFIX=${REDIS_PREFIX}
|
|
- ENABLE_GRAPH_RAG=${ENABLE_GRAPH_RAG}
|
|
- TENANT_AES_KEY=${TENANT_AES_KEY}
|
|
- CONCURRENCY_POOL_SIZE=${CONCURRENCY_POOL_SIZE:-5}
|
|
- INIT_LLM_MODEL_NAME=${INIT_LLM_MODEL_NAME}
|
|
- INIT_LLM_MODEL_BASE_URL=${INIT_LLM_MODEL_BASE_URL}
|
|
- INIT_LLM_MODEL_API_KEY=${INIT_LLM_MODEL_API_KEY}
|
|
- INIT_EMBEDDING_MODEL_NAME=${INIT_EMBEDDING_MODEL_NAME}
|
|
- INIT_EMBEDDING_MODEL_BASE_URL=${INIT_EMBEDDING_MODEL_BASE_URL}
|
|
- INIT_EMBEDDING_MODEL_API_KEY=${INIT_EMBEDDING_MODEL_API_KEY}
|
|
- INIT_EMBEDDING_MODEL_DIMENSION=${INIT_EMBEDDING_MODEL_DIMENSION}
|
|
- INIT_EMBEDDING_MODEL_ID=${INIT_EMBEDDING_MODEL_ID}
|
|
- INIT_RERANK_MODEL_NAME=${INIT_RERANK_MODEL_NAME}
|
|
- INIT_RERANK_MODEL_BASE_URL=${INIT_RERANK_MODEL_BASE_URL}
|
|
- INIT_RERANK_MODEL_API_KEY=${INIT_RERANK_MODEL_API_KEY}
|
|
depends_on:
|
|
redis:
|
|
condition: service_started
|
|
postgres:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_started
|
|
networks:
|
|
- WeKnora-network
|
|
restart: unless-stopped
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: WeKnora-minio
|
|
ports:
|
|
- "${MINIO_PORT:-9000}:9000"
|
|
- "${MINIO_CONSOLE_PORT:-9001}:9001"
|
|
environment:
|
|
- MINIO_ROOT_USER=${MINIO_ACCESS_KEY_ID:-minioadmin}
|
|
- MINIO_ROOT_PASSWORD=${MINIO_SECRET_ACCESS_KEY:-minioadmin}
|
|
command: server --console-address ":9001" /data
|
|
volumes:
|
|
- minio_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 30s
|
|
timeout: 20s
|
|
retries: 3
|
|
networks:
|
|
- WeKnora-network
|
|
|
|
frontend:
|
|
image: wechatopenai/weknora-ui:latest
|
|
container_name: WeKnora-frontend
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
- app
|
|
networks:
|
|
- WeKnora-network
|
|
restart: unless-stopped
|
|
|
|
docreader:
|
|
image: wechatopenai/weknora-docreader:latest
|
|
container_name: WeKnora-docreader
|
|
ports:
|
|
- "50051:50051"
|
|
environment:
|
|
- COS_SECRET_ID=${COS_SECRET_ID}
|
|
- COS_SECRET_KEY=${COS_SECRET_KEY}
|
|
- COS_REGION=${COS_REGION}
|
|
- COS_BUCKET_NAME=${COS_BUCKET_NAME}
|
|
- COS_APP_ID=${COS_APP_ID}
|
|
- COS_PATH_PREFIX=${COS_PATH_PREFIX}
|
|
- COS_ENABLE_OLD_DOMAIN=${COS_ENABLE_OLD_DOMAIN}
|
|
- VLM_MODEL_BASE_URL=${VLM_MODEL_BASE_URL}
|
|
- VLM_MODEL_NAME=${VLM_MODEL_NAME}
|
|
- VLM_MODEL_API_KEY=${VLM_MODEL_API_KEY}
|
|
- STORAGE_TYPE=${STORAGE_TYPE}
|
|
- MINIO_PUBLIC_ENDPOINT=http://localhost:${MINIO_PORT:-9000}
|
|
- MINIO_ENDPOINT=minio:9000
|
|
- MINIO_ACCESS_KEY_ID=${MINIO_ACCESS_KEY_ID:-minioadmin}
|
|
- MINIO_SECRET_ACCESS_KEY=${MINIO_SECRET_ACCESS_KEY:-minioadmin}
|
|
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}
|
|
- MINIO_USE_SSL=${MINIO_USE_SSL}
|
|
- WEB_PROXY=${WEB_PROXY}
|
|
networks:
|
|
- WeKnora-network
|
|
restart: unless-stopped
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
jaeger:
|
|
image: jaegertracing/all-in-one:latest
|
|
ports:
|
|
- "6831:6831/udp" # Jaeger Thrift接收器
|
|
- "6832:6832/udp" # Jaeger Thrift接收器(Compact)
|
|
- "5778:5778" # 配置端口
|
|
- "16686:16686" # Web UI
|
|
- "4317:4317" # OTLP gRPC接收器
|
|
- "4318:4318" # OTLP HTTP接收器
|
|
- "14250:14250" # 接收模型端口
|
|
- "14268:14268" # Jaeger HTTP接收器
|
|
- "9411:9411" # Zipkin兼容性端口
|
|
environment:
|
|
- COLLECTOR_OTLP_ENABLED=true
|
|
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
|
|
volumes:
|
|
- jaeger_data:/var/lib/jaeger # 持久化 Jaeger 数据
|
|
networks:
|
|
- WeKnora-network
|
|
restart: unless-stopped
|
|
# 修改的PostgreSQL配置
|
|
postgres:
|
|
image: paradedb/paradedb:latest
|
|
container_name: WeKnora-postgres
|
|
ports:
|
|
- "${DB_PORT}:5432"
|
|
environment:
|
|
- POSTGRES_USER=${DB_USER}
|
|
# NOCC:hardcode-password(工具误报)
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
|
- POSTGRES_DB=${DB_NAME}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./migrations/paradedb:/docker-entrypoint-initdb.d
|
|
networks:
|
|
- WeKnora-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
|
interval: 10s # 增加时间间隔
|
|
timeout: 10s # 增加超时时间
|
|
retries: 3 # 减少重试次数,让失败更快反馈
|
|
start_period: 30s # 给予初始启动更多时间
|
|
restart: unless-stopped
|
|
# 添加停机时的优雅退出时间
|
|
stop_grace_period: 1m
|
|
|
|
redis:
|
|
image: redis:7.0-alpine
|
|
container_name: WeKnora-redis
|
|
ports:
|
|
- "${REDIS_PORT}:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
|
restart: always
|
|
networks:
|
|
- WeKnora-network
|
|
|
|
networks:
|
|
WeKnora-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
postgres-data:
|
|
data-files:
|
|
jaeger_data:
|
|
redis_data:
|
|
minio_data:
|