version: '3.4'
name: cat2bug-platform
services:
  cat2bug-platform-ai:
    image: qyzw-docker.pkg.coding.net/cat2bug/cat2bug-platform/ollama:latest
    hostname: ollama
    container_name: cat2bug-platform-ai
    restart: always
    volumes:
      - ./ai:/root/.ollama
    expose:
      - "11434"
    environment:
      TZ: Asia/Shanghai
    healthcheck:
      test: "exit 0"
    networks:
      - cat2bug-network
  cat2bug-platform-mysql:
    image: qyzw-docker.pkg.coding.net/cat2bug/cat2bug-platform/mysql:latest
    hostname: mysql
    container_name: cat2bug-platform-mysql
    restart: always
    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
      --interactive_timeout=259200
      --wait_timeout=259200
      --max_connections=1000
    volumes:
      - ./mysql/:/var/lib/mysql
    expose:
      - "3306"
    environment:
      TZ: Asia/Shanghai
      MYSQL_ROOT_HOST: "%"
      MYSQL_DATABASE: cat2bug_platform
      MYSQL_ROOT_PASSWORD: cat2bug_password
      MYSQL_USER: cat2bug
      MYSQL_PASSWORD: cat2bug_password
    healthcheck:
      test: "mysql -h127.0.0.1 -P3306 -uroot -pcat2bug_password -e 'SHOW DATABASES;'"
      interval: 10s
      timeout: 5s
      retries: 6
      start_period: 30s
    networks:
      - cat2bug-network
  cat2bug-platform-redis:
    image: qyzw-docker.pkg.coding.net/cat2bug/cat2bug-platform/redis:7.2.3
    hostname: redis
    container_name: cat2bug-platform-redis
    restart: always
    expose:
      - "6739"
    healthcheck:
      test: "exit 0"
    networks:
      - cat2bug-network
  cat2bug-platform-web-after:
    hostname: after
    image: qyzw-docker.pkg.coding.net/cat2bug/cat2bug-platform/web-after:latest
    container_name: cat2bug-platform-web-after
    restart: always
    expose:
      - "2020"
    environment:
      SPRING_DATASOURCE_DRUID_MASTER_URL: jdbc:mysql://cat2bug-platform-mysql:3306/cat2bug_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
      SPRING_DATASOURCE_DRUID_MASTER_USERNAME: root
      SPRING_DATASOURCE_DRUID_MASTER_PASSWORD: cat2bug_password
      SPRING_REDIS_HOST: cat2bug-platform-redis
      REDIS_HOSTS: cat2bug-platform-redis:6379
      CAT2BUG_AI_HOST: http://cat2bug-platform-ai:11434
    volumes:
      - ./uploadPath:/home/uploadPath
      - ./logs:/home/logs
    links:
      - cat2bug-platform-mysql
      - cat2bug-platform-redis
      - cat2bug-platform-ai
    depends_on:
      cat2bug-platform-mysql:
        condition: service_healthy
      cat2bug-platform-redis:
        condition: service_healthy
      cat2bug-platform-ai:
        condition: service_healthy
    healthcheck:
      test: "exit 0"
    networks:
      - cat2bug-network
  cat2bug-platform-web-front:
    hostname: front
    image: qyzw-docker.pkg.coding.net/cat2bug/cat2bug-platform/web-front:latest
    container_name: cat2bug-platform-web-front
    restart: always
    ports:
      - "8022:80"
    links:
      - cat2bug-platform-web-after
    depends_on:
      cat2bug-platform-web-after:
        condition: service_healthy
    networks:
      - cat2bug-network
networks:
  cat2bug-network:
    driver: bridge
