Files
svfs/deploy/mqtt/docker-compose.yml
chakcy 9dc2dde59f
tests / ubuntu-latest / py3.13 (push) Has been cancelled
tests / windows-latest / py3.13 (push) Has been cancelled
tests / ubuntu-latest / py3.13 (pull_request) Has been cancelled
tests / windows-latest / py3.13 (pull_request) Has been cancelled
modify: 消息模块
2026-09-17 11:23:34 +08:00

32 lines
1.4 KiB
YAML
Raw Permalink 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 broker(mosquitto 2.x):svfs 消息模块的实时推送通道。
#
# docker compose up -d # 起
# docker compose logs -f mqtt # 看日志(配置里 log_dest stdout)
# docker compose down # 停
#
# 默认配置是「内网匿名」——能跑起来,但任何能连到 1883 的人都收发得到消息,
# 只适合内网/开发。上认证、ACL、TLS 见 config/mosquitto.conf 里的三个注释段,
# 完整说明见 docs/mqtt-guide.md 的「二、Docker 部署 broker」。
services:
mqtt:
image: eclipse-mosquitto:2
container_name: svfs-mqtt
restart: unless-stopped
ports:
- "1883:1883" # 明文:内网/开发(默认只开这个)
# - "8883:8883" # TLS:解 config/mosquitto.conf 的 TLS 段、放好证书再开这个
volumes:
# 配置目录整份挂进去(conf / acl / passwd / certs 都在这里)。
# 挂目录而不是单个文件:mosquitto_passwd 要往这里写密码文件,
# 只挂文件的话写进去的东西会落在容器层,重启就没了。
- ./config:/mosquitto/config
# 数据与日志用具名卷:容器里的 mosquitto 用户是 uid 1883,用宿主目录
# 在 Linux 上常撞权限错误;具名卷由 Docker 按镜像里的属主创建,开箱即用。
- mqtt-data:/mosquitto/data
- mqtt-log:/mosquitto/log
volumes:
mqtt-data:
mqtt-log: