Files
server-core/serverrun/mqtt/docker-compose.yml
T

65 lines
1.7 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.
# MQTT 消息服务(EMQX,大屏/桌面端实时总线)
name: opc-emqx
services:
emqx:
# image: 192.168.1.3:9998/pinesound/emqx:latest
image: emqx/emqx:latest
container_name: opc-emqx
pull_policy: always
restart: unless-stopped
environment:
# EMQX 集群名称
EMQX_CLUSTER__NAME: opc_cluster
# 节点名称
EMQX_NODE__NAME: emqx@127.0.0.1
# Dashboard 管理员密码
EMQX_DASHBOARD__DEFAULT_PASSWORD: "WSSmine4ever"
# MQTT TCP 监听器认证
EMQX_LISTENERS__TCP__DEFAULT__PROXY_PROTOCOL: false
# 内置数据库认证(MQTT 客户端连接用户名密码)
EMQX_AUTHENTICATION__BUILTIN__USERS: |
[
{
"username": "opc",
"password": "Opc123!"
}
]
# 允许匿名连接(设为 false 强制认证)
EMQX_ALLOW_ANONYMOUS: false
# MQTT 最大客户端数
EMQX_LISTENERS__TCP__DEFAULT__MAX_CONNECTIONS: 102400
# 日志等级
EMQX_LOG__LEVEL: info
ports:
# MQTT TCP
- "1883:1883"
# MQTT SSL
- "8883:8883"
# MQTT WebSocket
- "8083:8083"
# MQTT WebSocket SSL
- "8084:8084"
# Dashboard APIWeb 管理控制台)
- "18083:18083"
volumes:
# 持久化 EMQX 数据
- ../../serverdata/emqx-data:/opt/emqx/data
# 持久化 EMQX 日志
- ../../serverdata/emqx-log:/opt/emqx/log
user: "0:0" # 临时用 root 运行,彻底解决权限
healthcheck:
test: ["CMD", "emqx", "ctl", "status"]
interval: 15s
timeout: 5s
retries: 3
start_period: 30s
networks:
- opc-network
networks:
opc-network:
name: opc-network
external: true