feat: emqx template (MQTT Broker) (#556)

* feat: template for emqx

* chore: process meta

* fix: use websocket on port 443 instead of 8084

* docs: improve comments for emqx template

* fix: use emqx service name

* fix: use dummy domain instead of traefik

* fix: explicitly list dokplok-network

* fix(emqx): restart unless stopped

* fix(emqx): add healthcheck
This commit is contained in:
Khiet Tam Nguyen
2026-01-08 06:02:50 +11:00
committed by GitHub
parent 7417972335
commit 7c2f0d4f8e
4 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
# This templates requires additional traefik port mapping and entry point
# for port 8883 (mqtts over TCP)
#
# For the full instructions, refer to:
# - https://github.com/Dokploy/dokploy/discussions/3126
#
# The initial login credentials are:
# - USERNAME: admin
# - PASSWORD: public
services:
emqx:
image: emqx/emqx-enterprise:6.0.1
hostname: node1.emqx.com
environment:
EMQX_NODE_NAME: emqx@node1.emqx.com
expose:
- 1883 # MQTT
- 8083 # WS
- 18083 # Dashboard
volumes:
- emqx_data:/opt/emqx/data
- emqx_log:/opt/emqx/log
networks:
dokploy-network:
aliases:
- emqx-service
restart: unless-stopped
healthcheck:
test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
interval: 30s
timeout: 5s
retries: 3
labels:
# MQTT over TLS
- "traefik.tcp.routers.emqx-mqtts.entrypoints=mqtts"
- "traefik.tcp.routers.emqx-mqtts.rule=HostSNI(`broker.yourdomain.com`)" # Change domain
- "traefik.tcp.routers.emqx-mqtts.tls.certresolver=letsencrypt"
- "traefik.tcp.routers.emqx-mqtts.service=emqx-service"
- "traefik.tcp.services.emqx-service.loadbalancer.server.port=1883"
#
# Optional Web UI:
# - https://github.com/emqx/MQTTX/tree/main/web
#
# mqttx-web:
# image: emqx/mqttx-web:latest
# expose:
# - 80
#
volumes:
emqx_data:
emqx_log:
networks:
dokploy-network:
external: true

6
blueprints/emqx/emqx.svg Normal file
View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 22 240 277">
<g fill="#5551F4" fill-rule="evenodd">
<path d="M214.8 107.087H112.496v.021c-.142-.006-.282-.021-.425-.021-5.311 0-9.616 4.293-9.616 9.589 0 5.295 4.305 9.588 9.616 9.588.143 0 .283-.015.425-.022v.022H214.8c5.31 0 9.615-4.293 9.615-9.588 0-5.296-4.305-9.59-9.615-9.59m0 91.341H112.496v.02c-.142-.005-.282-.02-.425-.02-5.311 0-9.616 4.293-9.616 9.588s4.305 9.588 9.616 9.588c.143 0 .283-.015.425-.02v.02H214.8c5.31 0 9.615-4.293 9.615-9.588s-4.305-9.588-9.615-9.588m-26.876-36.082c0-5-3.84-9.101-8.739-9.545v-.044h-87.72v.022c-.142-.006-.281-.022-.425-.022-5.31 0-9.615 4.293-9.615 9.59 0 5.295 4.305 9.588 9.615 9.588.144 0 .283-.016.426-.022v.022h87.719v-.045c4.899-.442 8.739-4.544 8.739-9.544"/>
<path fill-rule="nonzero" d="M280 91.25 160 22 40 91.25v138.5L160 299l120-69.25zM160 42.712l102.049 58.894V219.38L160 278.276 57.939 219.38V101.606z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 940 B

View File

@@ -0,0 +1,11 @@
[variables]
[[config.domains]]
serviceName = "emqx"
port = 18083
host = "emqx.yourdomain.com"
[[config.domains]]
serviceName = "emqx"
port = 8083
host = "broker.yourdomain.com"

View File

@@ -2103,6 +2103,23 @@
"media system"
]
},
{
"id": "emqx",
"name": "EMQX",
"version": "6.0.1",
"description": "A scalable and reliable MQTT broker for AI, IoT, IIoT and connected vehicles",
"logo": "emqx.svg",
"links": {
"github": "https://github.com/emqx/emqx",
"website": "https://www.emqx.com",
"docs": "https://docs.emqx.com"
},
"tags": [
"broker",
"iot",
"mqtt"
]
},
{
"id": "enshrouded",
"name": "Enshrouded",