version: '2'
services:
  bqw-ai-system:
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
      LC_ALL: C.UTF-8
      DIFY_DB_HOST: 10.102.8.56
      DIFY_API_HOST: 10.102.8.56
      DIFY_API_PORT: 30080
    restart: always
    container_name: bqw-ai-system
    image: java:1.8.391
    volumes:
      - ./system/target/bqw-ai.jar:/application/app.jar
      - ./system/logs:/logs
      - ./system/data:/application/data
    command: java -jar -Dfile.encoding=UTF-8 /application/app.jar
    logging:
      driver: "json-file"
      options:
        max-size: "1024m"
        max-file: "3"
    depends_on:
      - bqw-ai-mysql
      - bqw-ai-redis
  bqw-ai-magic:
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
      LC_ALL: C.UTF-8
    restart: always
    container_name: bqw-ai-magic
    image: java:1.8.391
    depends_on:
      - bqw-ai-mysql
      - bqw-ai-redis
    volumes:
      - ./system/target/magic-api-demo.jar:/application/app.jar
      - ./system/logs:/logs
      - ./system/data:/application/data
    command: java -jar -Dfile.encoding=UTF-8 /application/app.jar
    logging:
      driver: "json-file"
      options:
        max-size: "1024m"
        max-file: "3"
  bqw-ai-mysql:
      environment:
        MYSQL_ROOT_PASSWORD: Mars@23600800
        MYSQL_ROOT_HOST: '%'
        MYSQL_DATABASE: ai-application
        TZ: Asia/Shanghai
      restart: always
      privileged: true
      container_name: bqw-ai-mysql
      image: mysql:8.0.33
      command:
        --character-set-server=utf8mb4
        --collation-server=utf8mb4_general_ci
        --explicit_defaults_for_timestamp=true
        --lower_case_table_names=1
        --max_allowed_packet=128M
        --default-authentication-plugin=caching_sha2_password
      volumes:
        - ./mysql/data/:/var/lib/mysql/
        - ./mysql/sql:/docker-entrypoint-initdb.d
  bqw-ai-redis:
      image: redis:7.0.4
      environment:
        TZ: Asia/Shanghai
      restart: always
      container_name: bqw-ai-redis
      volumes:
        - ./redis/conf:/redis/config:rw
        - ./redis/data/:/redis/data/:rw
      command: "redis-server /redis/config/redis.conf"
      privileged: true
  bqw-ai-web:
    image: nginx:1.23.4
    ports:
      - 18900:80
      - 18901:8080
      - 18902:8081
    restart: always
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
      LC_ALL: C.UTF-8
    container_name: bqw-ai-web
    volumes:
      - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/html/dist:/usr/share/nginx/html
      - ./nginx/html/chat:/usr/share/nginx/chat
      - ./nginx/html/llm_flow:/usr/share/nginx/llm_flow
      - ./nginx/html/electron_h5:/usr/share/nginx/electron_h5
    depends_on:
      - bqw-ai-system
    logging:
      driver: "json-file"
      options:
        max-size: "1024m"
        max-file: "3"
  bqw-ai-minio:
    image: minio/minio
    privileged: true
    restart: always
    container_name: bqw-ai-minio
    #    ports:
    #      # api端口
    #      - 9000:9000
    #      # 控制台页面端口
    #      - 9011:9011
    environment:
      TZ: Asia/Shanghai
      MINIO_ACCESS_KEY: admin
      MINIO_SECRET_KEY: Huashiai@2024
    volumes:
      - ./minio/data:/data
      - /etc/localtime:/etc/localtime:ro
    command: server /data --console-address ":9011"
    logging:
      driver: "json-file"
      options:
        max-size: "1024m"
        max-file: "3"
