.env
123
NR=1234IP1=192.168.1.11IP2=192.168.1.12
docker-compose.yml
12345678910111213
services: mqtt_server: build: . environment: - "EMQX_NAME=emqx-$NR" - "EMQX_HOST=$IP1" - "EMQX_CLUSTER__DISCOVERY_STRATEGY=static" - "EMQX_CLUSTER__STATIC__SEEDS=[emqx-$NR@$IP1, emqx-$NR@$IP2]" ports: - 1883:1883 - 8883:8883 - 5369:5369 # Clustering EMQX - 4370:4370 # Clustering Erlang
Dockerfile
FROM emqx:5.1.6ENV EMQX_NODE__COOKIE=secret-1928