Dragon
  • 蚂蚁资源欢迎你!
蚂蚁资源蚂蚁资源  2023-11-28 18:44 蚂蚁资源 |   抢沙发  152 
文章评分 1 次,平均分 5.0

项目展示

Tailchat1146X717.png

hero-light.png

plugins.png

image.png

Tailchat 官方信息:

官方网站

官方详细文档

官方APP下载

建议的最低配置 1 核 2G

前提条件

安装docker与docker-compose:

拉取 Tailchat 官方映像:

从公共镜像拉取已编译的镜像

docker pull moonrailgun/tailchat 
docker tag moonrailgun/tailchat tailchat

image.png

修改文件配置:

mkdir tailchat && cd tailchat
nano docker-compose.yml
nano docker-compose.env

官方配置模板:

docker-compose.yml:

version: "3.3"

services:
  # Gateway
  service-gateway:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICES: core/gateway
      PORT: 3000
    depends_on:
      - mongo
      - redis
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.api-gw.rule=PathPrefix(`/`)"
      - "traefik.http.services.api-gw.loadbalancer.server.port=3000"
    networks:
      - internal

  # User Service
  service-user:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICES: core/user/*.service.js
    depends_on:
      - mongo
      - redis
    networks:
      - internal

  # Group Service
  service-group:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICES: core/group/*.service.js
    depends_on:
      - mongo
      - redis
    networks:
      - internal

  # Chat Service
  service-chat:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICES: core/chat/*.service.js
    depends_on:
      - mongo
      - redis
    networks:
      - internal

  # File Service / Plugin Registry / Configuration Service
  service-file:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICES: core/file,core/plugin/registry,core/config
    depends_on:
      - mongo
      - redis
      - minio
    networks:
      - internal

  # Open Platform
  service-openapi:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICES: openapi/app,openapi/bot,openapi/integration,openapi/oidc/oidc
      OPENAPI_PORT: 3003
      OPENAPI_UNDER_PROXY: "true"
    depends_on:
      - mongo
      - redis
      - minio
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.openapi-oidc.rule=PathPrefix(`/open`)"
      - "traefik.http.services.openapi-oidc.loadbalancer.server.port=3003"
    networks:
      - internal

  # Plugin Service (All Plugins)
  service-all-plugins:
    build:
      context: .
    image: tailchat
    restart: unless-stopped
    env_file: docker-compose.env
    environment:
      SERVICEDIR: plugins
    depends_on:
      - mongo
      - redis
      - minio
    networks:
      - internal

  # Database
  mongo:
    image: mongo:4
    restart: on-failure
    volumes:
      - ./data:/data/db
    networks:
      - internal

  # Data cache and Transporter
  redis:
    image: redis:alpine
    restart: on-failure
    networks:
      - internal

  # Persist Storage
  minio:
    image: minio/minio
    restart: on-failure
    networks:
      - internal
    environment:
      MINIO_ROOT_USER: tailchat
      MINIO_ROOT_PASSWORD: com.msgbyte.tailchat
    volumes:
      - ./storage:/data
    command: minio server /data --console-address ":9001"

  # Router
  traefik:
    image: traefik:v2.1
    restart: unless-stopped
    command:
      - "--api.insecure=true" # Don't do that in production!
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entryPoints.web.address=:80"
      - "--entryPoints.web.forwardedHeaders.insecure" # Not good
    ports:
      - 11000:80
      - 127.0.0.1:11001:8080
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - internal
      - default

networks:
  internal:
    name: tailchat-internal

volumes:
  data:
  storage:

docker-compose.env:

LOGGER=true
LOGLEVEL=info
SERVICEDIR=services

TRANSPORTER=redis://redis:6379

REDIS_URL=redis://redis:6379
MONGO_URL=mongodb://mongo/tailchat
SECRET=

# file
API_URL=https://chat.antszy.com

# minio
MINIO_URL=minio:9000
MINIO_USER=tailchat
MINIO_PASS=com.msgbyte.tailchat

# SMTP
SMTP_SENDER=123456789@qq.com
SMTP_URI=smtps://123456789:aaa@smtp.qq.com/?pool=true

# metrics
PROMETHEUS=1

docker-compose.env说明

docker-compose.env:
- API_URL:是外部可访问的 URL 地址,用于文件服务访问,可以是域名或 IP 如果发送的图片无法正常显示,则不设置此变量
- SECRET:服务器端加密密钥,用于生成令牌。默认值为tailchat

启动Tailchat:

docker compose up -d

网页访问:

IP+11000
例如:
192.168.31.243:11000

部署管理后台(可选后续有用到)

docker compose -f docker-compose.yml -f admin.yml up -d 

本文为原创文章,版权归所有,欢迎分享本文,转载请保留出处!

蚂蚁资源
蚂蚁资源 关注:0    粉丝:20
这个人很懒,什么都没写

发表评论

表情 格式 链接 私密 签到
扫一扫二维码分享
Tips:可以在右上角“关注”找到我们的联系方式!