From aaa2da78b34a57c8d9626e5bc9f60b931ebac0a0 Mon Sep 17 00:00:00 2001 From: pasindu Date: Wed, 17 Jul 2024 17:18:50 +0530 Subject: [PATCH] Fix plugins adding issue --- Dockerfile | 4 ++-- entrypoint.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b677ee2..36ea1d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,17 +18,17 @@ FROM emqx/emqx:4.4.11 ARG STATIC_CONFIG_PATH=/opt/emqx/lib/emqx_dashboard-4.4.10/priv/www/static/ +USER root # Copy static files COPY /static/css/* ${STATIC_CONFIG_PATH}/css/ COPY /static/img/* ${STATIC_CONFIG_PATH}/img/ # Copy configuration and data files COPY /configs/emqx_exhook.conf /opt/emqx/etc/plugins/ -COPY /data/loaded_plugins /opt/emqx/data/ +COPY /data/loaded_plugins /opt/data/ EXPOSE 1883 8083 8084 8883 11883 18083 4370 5369 COPY ./entrypoint.sh /opt/emqx/bin/entrypoint.sh -USER root RUN chmod +x /opt/emqx/bin/entrypoint.sh ENTRYPOINT ["/opt/emqx/bin/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 481bab8..a4578d3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,5 +21,9 @@ CONFIG_PATH=/opt/emqx/etc/plugins/emqx_exhook.conf # Set emqx_exhook.conf configs sed -i 's/${SERVER_HOSTNAME}/'$SERVER_HOSTNAME'/g' $CONFIG_PATH +# Add plugins +rm -f /opt/emqx/data/loaded_plugins +mv /opt/data/loaded_plugins /opt/emqx/data/loaded_plugins + echo "Starting server.." sh /opt/emqx/bin/emqx foreground