services:
  physical-mysql:
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_ROOT_HOST: '%'
      TZ: Asia/Shanghai
      MYSQL_DATABASE: physical-boot
    restart: always
    container_name: physical-mysql
    image: registry.cn-shanghai.aliyuncs.com/physical/physical-mysql
    hostname: physical-mysql
    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
    ports:
      - 23306:3306
    volumes:
      - mysql_data:/var/lib/mysql
      - ./db/:/docker-entrypoint-initdb.d/
    networks:
      - physical-boot

  physical-redis:
    image: registry.cn-shanghai.aliyuncs.com/physical/physical-redis
    ports:
      - 26379:6379
    restart: always
    hostname: physical-redis
    container_name: physical-redis
    networks:
      - physical-boot
  physical-minio:
    image: registry.cn-shanghai.aliyuncs.com/physical/physical-minio
    ports:
      - 29000:9000
      - 29001:9001
    restart: always
    hostname: physical-minio
    container_name: physical-minio
    environment:
      MINIO_ROOT_USER: root
      MINIO_ROOT_PASSWORD: 12345678
    volumes:
      - minio_data:/data
    command: server /data --console-address ":9001"
    networks:
      - physical-boot

  physical-launcher:
    restart: on-failure
    environment:
      PROFILE: test
    depends_on:
      - physical-mysql
      - physical-redis
      - physical-minio
    container_name: physical-launcher
    image: registry.cn-shanghai.aliyuncs.com/physical/physical-boot
    hostname: physical-launcher
    ports:
      - 28080:8080
    networks:
      - physical-boot
    volumes:
      - ./logs:/app/logs
#  physical-kkfileview:
#    restart: on-failure
#    container_name: physical-kkfileview
#    image: registry.cn-shanghai.aliyuncs.com/physical/kkfileview
#    hostname: physical-kkfileview
#    ports:
#      - 81:8012
#    networks:
#      - physical-boot

  physical-web:
    container_name: physical-web
    image: registry.cn-shanghai.aliyuncs.com/physical/physical-web
    hostname: physical-web
    networks:
      - physical-boot
    ports:
      - 8005:80
#  physical-crawler:
#    container_name: physical-crawler
#    restart: on-failure
#    depends_on:
#      - physical-mysql
#      - physical-minio
#    image: registry.cn-shanghai.aliyuncs.com/physical/physical-crawler
#    ports:
#      - "25000:5000"
#    environment:
#      - FLASK_ENV=production
#      - PYTHONUNBUFFERED=1  # 禁用 Python 输出缓冲
#    volumes:
#      - ./crawler_files:/app/downloaded_files

networks:
  physical-boot:
    name: physical_boot

volumes:
  minio_data:
  mysql_data:
