Not worked updating emqx.config file by docker compose file envrionment variables in Emqx version 5

I try to build EMQX cluster by Docker Compose file. When excute compose file ,container successfully created with environment variable. I can see Environment varibales in container inspect but In emqx.conf file did’t updated which i mentioned environment variable in compose file.

Here is emqx docker compose file:

version: '3'

services:
  emqx1:
    image: emqx:latest
    container_name: emqx1
    environment:
    - "EMQX_NODE_NAME=emqx@node1.emqx.io"
    - "EMQX_CLUSTER__DISCOVERY_STRATEGY=static"
    - "EMQX_CLUSTER__STATIC__SEEDS=[emqx@node1.emqx.io,emqx@node2.emqx.io]"
    - "EMQX_LISTENER__SSL__EXTERNAL__CERTFILE=etc/certs/emqx.pem"
    - "EMQX_LISTENER__SSL__EXTERNAL__CACERTFILE=etc/certs/ca.pem"
    - "EMQX_LISTENER__SSL__EXTERNAL__KEYFILE=etc/certs/emqx.key"
    healthcheck:
      test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
      interval: 5s
      timeout: 25s
      retries: 5
    networks:
      emqx-bridge:
        aliases:
        - node1.emqx.io
    ports:
      - 8883:8883
      - 18083:18083 
    # volumes:
    #   - $PWD/emqx1_data:/opt/emqx/data
    volumes:
       - ./certs:/opt/emqx/etc/certs

  
networks:
  emqx-bridge:
    driver: bridge

I attached container inspect and emqx.conf file. Please have a look


I suppose the variables should be named something else for EMQX 5.0 than for EMQX 4. See Configuration Files | EMQX 5.0 Documentation for more information and an example about that.

Combined with Listeners | EMQX 5.0 Documentation this led me to the following variable names:

     - "EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__CERTFILE=etc/certs/cert.pem"  
     - "EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__KEYFILE=etc/certs/key.pem"    
     - "EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__CACERTFILE=etc/certs/cacert.pem"
1 Like