Skip to content

Commit

Permalink
NET-517 (#2510)
Browse files Browse the repository at this point in the history
* Fixed emqx docker compose file syntax and added volumes for persistence.

* Added helper comments for docker-compose.yml and netmaker.env files to enable emqx broker support.
  • Loading branch information
uGiFarukh authored Aug 11, 2023
1 parent a9a8596 commit 185728a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
19 changes: 14 additions & 5 deletions compose/docker-compose-emqx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ services:
mq:
container_name: mq
image: emqx/emqx:5.0.9
env_file: ./netmaker.env
restart: unless-stopped
environment:
- EMQX_NAME: "emqx"
- EMQX_NAME=emqx
- EMQX_DASHBOARD__DEFAULT_PASSWORD=${MQ_PASSWORD}
- EMQX_DASHBOARD__DEFAULT_USERNAME=${MQ_USERNAME}
ports:
- "1883:1883" # MQTT
- "8883:8883" # SSL MQTT
- "8083:8083" # Websockets
- "1883:1883" # MQTT
- "8883:8883" # SSL MQTT
- "8083:8083" # Websockets
- "8084:8084" # SSL Websockets
- "18083:18083" # Dashboard/REST_API

volumes:
- emqx_data:/opt/emqx/data
- emqx_etc:/opt/emqx/etc
- emqx_logs:/opt/emqx/log
volumes:
emqx_data: { } # storage for emqx data
emqx_etc: { } # storage for emqx etc
emqx_logs: { } # storage for emqx logs
5 changes: 4 additions & 1 deletion compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ services:
# config-dependant vars
- STUN_LIST=stun1.netmaker.io:3478,stun2.netmaker.io:3478,stun1.l.google.com:19302,stun2.l.google.com:19302
# The domain/host IP indicating the mq broker address
- BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}
- BROKER_ENDPOINT=wss://broker.${NM_DOMAIN} # For EMQX broker use `BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}/mqtt`
# For EMQX broker (uncomment the two lines below)
#- BROKER_TYPE=emqx
#- EMQX_REST_ENDPOINT=http://mq:18083
# The base domain of netmaker
- SERVER_NAME=${NM_DOMAIN}
- SERVER_API_CONN_STRING=api.${NM_DOMAIN}:443
Expand Down
2 changes: 1 addition & 1 deletion scripts/netmaker.default.env
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ DISPLAY_KEYS="on"
DATABASE="sqlite"
# The address of the mq server. If running from docker compose it will be "mq". Otherwise, need to input address.
# If using "host networking", it will find and detect the IP of the mq container.
SERVER_BROKER_ENDPOINT="ws://mq:1883"
SERVER_BROKER_ENDPOINT="ws://mq:1883" # For EMQX websockets use `SERVER_BROKER_ENDPOINT=ws://mq:8083/mqtt`
# The reachable port of STUN on the server
STUN_PORT="3478"
# Logging verbosity level - 1, 2, or 3
Expand Down

0 comments on commit 185728a

Please sign in to comment.