networks:
  zsElectric-boot:
    driver: bridge

services:
  minio:
    image: minio/minio:RELEASE.2024-07-16T23-46-41Z
    container_name: minio
    restart: unless-stopped
    command: server /data --console-address ":9001"
    ports:
      - 9000:9000
      - 9001:9001
    environment:
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
      - MINIO_ROOT_USER=minioadmin
      - MINIO_ROOT_PASSWORD=minioadmin
    volumes:
      - ./minio/data:/data
      - ./minio/config:/root/.minio
    networks:
      - zsElectric-boot

  xxl-job-admin:
    image: xuxueli/xxl-job-admin:2.4.0
    container_name: xxl-job-admin
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      PARAMS: '--spring.datasource.url=jdbc:mysql://host.docker.internal:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=root --spring.datasource.password=FaajjVy8rl(k --spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver'
    volumes:
      - ./xxljob/logs:/data/applogs
    ports:
      - 8080:8080
    networks:
      - zsElectric-boot

  zsElectric-app:
    image: openjdk:17-jdk-alpine
    container_name: zsElectric-app
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      - TZ=Asia/Shanghai
      - JAVA_OPTS=-Xmx512m -Xms256m
      - LANG=en_US.UTF-8
    volumes:
      - /home/zsElectric-boot/zsElectric-boot.jar:/app.jar
    command: >
      sh -c "
      apk update &&
      apk add --no-cache fontconfig ttf-dejavu ttf-liberation ttf-freefont &&
      mkdir -p /usr/share/fonts/truetype/custom &&
      java -jar /app.jar --server.port=8989
      "
    ports:
      - 8989:8989
    networks:
      - zsElectric-boot
    depends_on:
      - minio
      - xxl-job-admin