Files
aiot-platform-cloud/docker-compose.release.yml
lzh 4a8641571f
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
feat(video): Release 环境部署独立 ZLM + video-server
- 添加 zlmediakit-release 容器(host 网络)
- 添加 video-server 连接本地 ZLM
- ZLM HTTP 7080 / RTSP 7554 / RTMP 7935 / RTP 30000-30500
- Hook URL 指向 127.0.0.1:48093 (video-server)
- SIP ID 末位 02 与 Prod 区分
- Secret 统一使用 u3UapOhmZa9er7S37Hc2k695NlZOBYdB

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 11:02:23 +08:00

307 lines
10 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ============================================
# 后端核心服务 - 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 namespace8efd6d96-... → e635b215-...
# - TDengine databaseaiot_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:
zlm-data: # ZLM 录像存储
# ============================================
# 公共环境变量片段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
# ===== RocketMQrelease 服务器本地实例,内网,无 ACL =====
ROCKETMQ_NAMESRV_ADDR: 172.17.16.7:9876
ROCKETMQ_ACCESS_KEY: ""
ROCKETMQ_SECRET_KEY: ""
# ===== XXL-Job同 adminexecutor 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
# ===== ZLMediaKit 媒体服务器Release 环境独立部署) =====
zlmediakit:
image: zlmediakit/zlmediakit:master
container_name: zlmediakit-release
restart: on-failure:5
network_mode: host # 使用宿主机网络,简化 RTP 端口映射
environment:
TZ: Asia/Shanghai
volumes:
- ./docker-compose/zlm-config-release.ini:/opt/media/conf/config.ini:ro
- zlm-data:/opt/media/bin/www # 录像持久化
deploy:
resources:
limits:
memory: 512m
cpus: '0.5'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7080/index/api/api_summary"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# ===== Video 视频模块(连接本地 ZLM =====
viewsh-module-video-server:
image: ${REGISTRY_HOST:-172.17.16.7:5000}/viewsh-module-video-server:${IMAGE_TAG:-latest}
container_name: aiot-video-server-release
restart: on-failure:5
ports:
- "48093:48093" # 应用端口
- "5060:5060" # SIP UDP/TCP设备注册
- "5060:5060/udp"
- "9905:9905" # XXL-Job executor
environment:
<<: *common-env
JAVA_OPTS: "-Xms512m -Xmx1024m -XX:+UseContainerSupport -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs"
XXL_JOB_EXECUTOR_PORT: 9905
# ===== SIP 配置Release 环境独立 SIP ID =====
SIP_ID: "44010200492000000002"
SIP_DOMAIN: "4401020049"
# ===== ZLMediaKit 连接配置(连接本地 host 网络 ZLM =====
ZLM_SERVER_ID: "zlmediakit-release"
ZLM_IP: "127.0.0.1" # host 网络,直接用宿主机地址
ZLM_HTTP_PORT: "7080" # ZLM HTTP 端口(避免与宿主机 80 冲突)
ZLM_SECRET: "u3UapOhmZa9er7S37Hc2k695NlZOBYdB"
ZLM_AUTO_CONFIG: "true"
volumes:
- app-logs:/app/logs
deploy:
resources:
limits:
memory: 1536m
cpus: '1.0'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:48093/actuator/health"]
interval: 10s
timeout: 5s
retries: 12
start_period: 120s
depends_on:
viewsh-module-ops-server:
condition: service_healthy
zlmediakit:
condition: service_healthy