version: '3.8'
name: fzx-aliyun-dev

networks:
  fzx-aliyun-dev-network:
    external: true

services:
  mariadb:
    container_name: fzx-aliyun-mariadb
    image: docker.m.daocloud.io/library/mariadb:10.11
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - mariadb
    ports:
      - "0.0.0.0:3306:3306"
    environment:
      MARIADB_ROOT_PASSWORD: fzx@2024!root
      MARIADB_DATABASE: fzx_local_life
      MARIADB_USER: fzx_app
      MARIADB_PASSWORD: fzx@2024!dev
    command:
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --init-connect=SET NAMES utf8mb4
      - --skip-character-set-client-handshake
    volumes:
      - /opt/Fzxpodman/mariadb/data:/var/lib/mysql

  redis:
    container_name: fzx-aliyun-redis
    image: docker.m.daocloud.io/library/redis:7.2.4
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - redis
    ports:
      - "0.0.0.0:6379:6379"
    command: redis-server --requirepass fzx@2024!redis --maxmemory 768mb --maxmemory-policy allkeys-lru --appendonly yes
    volumes:
      - /opt/Fzxpodman/redis/data:/data

  nacos:
    container_name: fzx-aliyun-nacos
    image: docker.m.daocloud.io/nacos/nacos-server:v2.4.3
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - nacos
    ports:
      - "0.0.0.0:8848:8848"
      - "0.0.0.0:9848:9848"
    environment:
      MODE: standalone
      SPRING_DATASOURCE_PLATFORM: mysql
      MYSQL_SERVICE_HOST: mariadb
      MYSQL_SERVICE_DB_NAME: fzx_local_life
      MYSQL_SERVICE_USER: fzx_app
      MYSQL_SERVICE_PASSWORD: fzx@2024!dev
      MYSQL_SERVICE_PORT: 3306
      NACOS_AUTH_ENABLE: "false"
      NACOS_JVM_ARGS: "-Xms384M -Xmx768M"
    volumes:
      - /opt/Fzxpodman/nacos/data:/home/nacos/data

  api-gateway:
    container_name: fzx-aliyun-api-gateway
    image: localhost:5000/fzx/api-gateway:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - api-gateway
    ports:
      - "0.0.0.0:8083:8080"
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      NACOS_NAMESPACE: ${NACOS_NAMESPACE:dev}
      JWT_SECRET_KEY: fzx_local_life_jwt_secret_key_2024_secure_key
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  user-service:
    container_name: fzx-aliyun-user-service
    image: localhost:5000/fzx/user-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - user-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JWT_SECRET_KEY: fzx_local_life_jwt_secret_key_2024_secure_key
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  auth-service:
    container_name: fzx-aliyun-auth-service
    image: localhost:5000/fzx/auth-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - auth-service
    ports:
      - "0.0.0.0:8082:8082"
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JWT_SECRET_KEY: fzx_local_life_jwt_secret_key_2024_secure_key
      SERVER_PORT: "8082"
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  merchant-service:
    container_name: fzx-aliyun-merchant-service
    image: localhost:5000/fzx/merchant-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - merchant-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  order-service:
    container_name: fzx-aliyun-order-service
    image: localhost:5000/fzx/order-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - order-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  rider-service:
    container_name: fzx-aliyun-rider-service
    image: localhost:5000/fzx/rider-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - rider-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  product-service:
    container_name: fzx-aliyun-product-service
    image: localhost:5000/fzx/product-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - product-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  marketing-service:
    container_name: fzx-aliyun-marketing-service
    image: localhost:5000/fzx/marketing-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - marketing-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  map-service:
    container_name: fzx-aliyun-map-service
    image: localhost:5000/fzx/map-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - map-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms384M -Xmx576M"
    depends_on:
      - mariadb
      - redis
      - nacos

  upload-service:
    container_name: fzx-aliyun-upload-service
    image: localhost:5000/fzx/upload-service:v1.1.0
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - upload-service
    environment:
      SPRING_PROFILES_ACTIVE: aliyun-dev
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/fzx_local_life?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8mb4
      SPRING_DATASOURCE_USERNAME: fzx_app
      SPRING_DATASOURCE_PASSWORD: fzx@2024!dev
      SPRING_REDIS_HOST: redis
      SPRING_REDIS_PORT: 6379
      SPRING_REDIS_PASSWORD: fzx@2024!redis
      NACOS_SERVER_ADDR: nacos:8848
      JAVA_OPTS: "-Xms256M -Xmx384M"
    depends_on:
      - mariadb
      - redis
      - nacos

  nginx:
    container_name: fzx-aliyun-nginx
    image: docker.m.daocloud.io/library/nginx:1.25.5
    restart: always
    networks:
      fzx-aliyun-dev-network:
        aliases:
          - nginx
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"
      - "0.0.0.0:8080:8080"
    volumes:
      - /opt/Fzxpodman/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
      - /opt/Fzxpodman/nginx/html:/usr/share/nginx/html:ro
    depends_on:
      - api-gateway
