version: '3'

services:
  mysql:
    image: mysql:8.0.33
    container_name: mysql
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: ry-vue
    ports:
      - "3307:3306"
    volumes:
      - ./ry-vue.sql:/docker-entrypoint-initdb.d/ry-vue.sql
    command:
      --default-authentication-plugin=mysql_native_password
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_general_ci
      --explicit_defaults_for_timestamp=true
      --lower_case_table_names=1

  ruoyi-server:
    image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/ai:1.2.1
    ports:
      - "6039:6039"
    container_name: ruoyi-server
    environment:
      TZ: Asia/Shanghai
      # 运行端口号
      SERVER_PORT: 6039
      # 数据库连接地址
      DB_URL: jdbc:mysql://mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
      # 数据库用户名
      DB_USERNAME: root
      # 数据库用户密码
      DB_PASSWORD: root
      # Redis地址
      REDIS_HOST: redis
      # Redis端口
      REDIS_PORT: 6379
      # 数据库索引
      REDIS_DATABASE: 0
      # Redis密码
      REDIS_PASSWORD:
      # 连接超时时间
      REDIS_TIMEOUT: 10s
    volumes:
      - /docker/server2/logs/:/ruoyi/server/logs/

  ruoyi-web:
    image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/web:1.2.1
    ports:
      - "8081:8081"
    container_name: ruoyi-web


  ruoyi-admin:
    image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/admin:1.2.1
    ports:
      - "8082:8082"
    container_name: ruoyi-admin



