# ============================================ # 后端核心服务 - RELEASE 环境(172.17.16.7) # ============================================ # 由 Jenkins release/next 分支自动同步到部署机后用: # docker compose -f docker-compose.release.yml up -d # 与 docker-compose.core.yml 区别: # - MySQL 库:aiot-platform-test → aiot-platform-release # - Nacos namespace:8efd6d96-... → e635b215-... # - TDengine database:aiot_platform → aiot_platform_release # - XXL-Job executor IP:.14 → .7、appname 加 -release 后缀 # - RocketMQ:腾讯云外网 → staging 服务器内网 172.17.16.7:9876(无 ACL) # 其余密码/凭据沿用 prod(同 docker-compose.core.yml) # ============================================ version: '3.8' networks: default: name: 1panel-network external: true volumes: app-logs: # ============================================ # 公共环境变量片段(YAML anchor) # ============================================ x-common-env: &common-env TZ: Asia/Shanghai SPRING_PROFILES_ACTIVE: prod # ===== Nacos(独立 namespace) ===== NACOS_USERNAME: nacos NACOS_PASSWORD: "9oDxX~}e7DeP" NACOS_ADDR: 172.17.16.7:8848 NACOS_DISCOVERY_NAMESPACE: "e635b215-913e-4bc8-8867-2fbf7d5134aa" NACOS_CONFIG_NAMESPACE: "e635b215-913e-4bc8-8867-2fbf7d5134aa" # ===== MySQL(同实例独立库 aiot-platform-release) ===== SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_URL: jdbc:mysql://172.17.16.8:3306/aiot-platform-release?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_USERNAME: root SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_PASSWORD: "tKi8rfUJjVrf@" # ===== Redis(同 prod 实例,靠 db 索引隔离:prod=db0、release=db1) ===== SPRING_DATA_REDIS_HOST: 172.17.16.13 SPRING_DATA_REDIS_PORT: 6379 SPRING_DATA_REDIS_PASSWORD: "HkVZkVnn1" SPRING_DATA_REDIS_DATABASE: 1 # ===== RocketMQ(release 服务器本地实例,内网,无 ACL) ===== ROCKETMQ_NAMESRV_ADDR: 172.17.16.7:9876 ROCKETMQ_ACCESS_KEY: "" ROCKETMQ_SECRET_KEY: "" # ===== XXL-Job(同 admin,executor IP=.7、appname 加 -release 后缀) ===== XXL_JOB_ADMIN_ADDRESSES: http://172.17.16.7:19090/xxl-job-admin XXL_JOB_EXECUTOR_IP: 172.17.16.7 XXL_JOB_EXECUTOR_APPNAME_SUFFIX: "-release" services: viewsh-gateway: image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-gateway:${IMAGE_TAG:-latest} container_name: aiot-gateway-release restart: on-failure:5 ports: - "48080:48080" environment: <<: *common-env JAVA_OPTS: "-Xms512m -Xmx1024m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs" volumes: - app-logs:/app/logs deploy: resources: limits: memory: 1536m cpus: '1.0' healthcheck: test: ["CMD", "curl", "-f", "http://localhost:48080/actuator/health"] interval: 10s timeout: 5s retries: 12 start_period: 120s viewsh-module-system-server: image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-module-system-server:${IMAGE_TAG:-latest} container_name: aiot-system-server-release restart: on-failure:5 ports: - "48081:48081" - "9901:9901" environment: <<: *common-env JAVA_OPTS: "-Xms512m -Xmx1024m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs" # 微信配置(system-server 独有,沿用 prod) WX_MP_APP_ID: "wx5b23ba7a5589ecbb" WX_MP_SECRET: "2a7b3b20c537e52e74afd395eb85f61f" WX_MINIAPP_APPID: "wxc4598c446f8a9cb3" WX_MINIAPP_SECRET: "4a1a04e07f6a4a0751b39c3064a92c8b" XXL_JOB_EXECUTOR_PORT: 9901 volumes: - app-logs:/app/logs deploy: resources: limits: memory: 1536m cpus: '1.0' healthcheck: test: ["CMD", "curl", "-f", "http://localhost:48081/actuator/health"] interval: 10s timeout: 5s retries: 12 start_period: 120s depends_on: viewsh-gateway: condition: service_healthy viewsh-module-infra-server: image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-module-infra-server:${IMAGE_TAG:-latest} container_name: aiot-infra-server-release restart: on-failure:5 ports: - "48082:48082" - "9902:9902" environment: <<: *common-env JAVA_OPTS: "-Xms512m -Xmx1024m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs" XXL_JOB_EXECUTOR_PORT: 9902 volumes: - app-logs:/app/logs healthcheck: test: ["CMD", "curl", "-f", "http://localhost:48082/actuator/health"] interval: 10s timeout: 5s retries: 12 start_period: 120s depends_on: viewsh-module-system-server: condition: service_healthy viewsh-module-iot-server: image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-module-iot-server:${IMAGE_TAG:-latest} container_name: aiot-iot-server-release restart: on-failure:5 ports: - "48091:48091" - "9903:9903" environment: <<: *common-env JAVA_OPTS: "-Xms1024m -Xmx2048m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs" # ===== 时序库(共享 prod TDengine 实例,独立 database aiot_platform_release) ===== TSDB_TYPE: tdengine TDENGINE_HOST: 172.17.16.7 TDENGINE_PORT: 6041 TDENGINE_USERNAME: root TDENGINE_PASSWORD: taosdata TDENGINE_DATABASE: aiot_platform_release # CTSDB 切换 follow-up(暂留空) CTSDB_URL: "" CTSDB_USERNAME: "" CTSDB_PASSWORD: "" CTSDB_DATABASE: "" XXL_JOB_EXECUTOR_PORT: 9903 volumes: - app-logs:/app/logs deploy: resources: limits: memory: 2560m cpus: '1.5' healthcheck: test: ["CMD", "curl", "-f", "http://localhost:48091/actuator/health"] interval: 10s timeout: 5s retries: 12 start_period: 120s depends_on: viewsh-module-infra-server: condition: service_healthy viewsh-module-iot-gateway: image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-module-iot-gateway:${IMAGE_TAG:-latest} container_name: aiot-iot-gateway-release restart: on-failure:5 ports: - "1883:1883" - "8092:8092" - "8091:8091" environment: IOT_TCP_ENABLED: "true" TZ: Asia/Shanghai SPRING_PROFILES_ACTIVE: prod JAVA_OPTS: "-Xms1024m -Xmx2048m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs" SPRING_DATA_REDIS_HOST: 172.17.16.13 SPRING_DATA_REDIS_PORT: 6379 SPRING_DATA_REDIS_PASSWORD: "HkVZkVnn1" SPRING_DATA_REDIS_DATABASE: 1 ROCKETMQ_NAMESRV_ADDR: 172.17.16.7:9876 ROCKETMQ_ACCESS_KEY: "" ROCKETMQ_SECRET_KEY: "" VIEWSH_IOT_GATEWAY_RPC_URL: "http://aiot-iot-server-release:48091" volumes: - app-logs:/app/logs deploy: resources: limits: memory: 2560m cpus: '1.5' depends_on: - viewsh-module-iot-server viewsh-module-ops-server: image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-module-ops-server:${IMAGE_TAG:-latest} container_name: aiot-ops-server-release restart: on-failure:5 ports: - "48092:48092" - "9904:9904" environment: <<: *common-env JAVA_OPTS: "-Xms512m -Xmx1024m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs" XXL_JOB_EXECUTOR_PORT: 9904 volumes: - app-logs:/app/logs healthcheck: test: ["CMD", "curl", "-f", "http://localhost:48092/actuator/health"] interval: 10s timeout: 5s retries: 12 start_period: 120s depends_on: viewsh-module-iot-server: condition: service_healthy