Add Env variable for exhook.server.default.url in configs

master
Pasindu Rupasinghe 5 months ago
parent c88adc8626
commit 5ee07c57a9

@ -12,4 +12,7 @@ COPY /data/loaded_plugins /opt/emqx/data/
EXPOSE 1883 8083 8084 8883 11883 18083 4370 5369
ENTRYPOINT ["sh", "/opt/emqx/bin/emqx", "foreground"]
COPY ./entrypoint.sh /opt/emqx/bin/entrypoint.sh
USER root
RUN chmod +x /opt/emqx/bin/entrypoint.sh
ENTRYPOINT ["/opt/emqx/bin/entrypoint.sh"]

@ -48,7 +48,7 @@
## The gRPC server url
##
## exhook.server.$name.url = url()
exhook.server.default.url = http://switch-gear:9000
exhook.server.default.url = http://${SG_HOSTNAME}:9000
#exhook.server.default.ssl.cacertfile = etc/certs/cacert.pem
#exhook.server.default.ssl.certfile = etc/certs/cert.pem

@ -18,9 +18,9 @@ services:
- ./static:/opt/emqx/static
- ./configs:/opt/emqx/configs
# environment:
environment:
# Hostname configurations
# - MGT_HOSTNAME=localhost
- SG_HOSTNAME=switchgear
# - MGT_HTTPS_PORT=9443
# - MGT_HTTP_PORT=9763
#

@ -0,0 +1,9 @@
#!/bin/bash
CONFIG_PATH=/opt/emqx/etc/plugins/emqx_exhook.conf
# Set emqx_exhook.conf configs
sed -i 's/${SG_HOSTNAME}/'$SG_HOSTNAME'/g' $CONFIG_PATH
echo "Starting server.."
sh /opt/emqx/bin/emqx foreground
Loading…
Cancel
Save