From c88adc86266bb89e287cc97fcf5f74fd693f4dcd Mon Sep 17 00:00:00 2001 From: pasindu Date: Tue, 28 May 2024 12:49:11 +0530 Subject: [PATCH] Added conf and data files to the container --- .gitignore | 21 +++++++++++++++++++++ Dockerfile | 15 +++++++++++---- configs/emqx_exhook.conf | 2 +- data/loaded_plugins | 9 +++++++++ entrypoint.sh | 11 ----------- 5 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 .gitignore create mode 100644 data/loaded_plugins delete mode 100644 entrypoint.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61d85f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Ignore everything in this directory +target +.classpath +.settings +.project +*.iml +*.iws +*.ipr +.idea +*.ids +.editorconfig +.gradle + +# Mac crap +.DS_Store diff --git a/Dockerfile b/Dockerfile index 9b9e88d..97e7ca0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,15 @@ FROM emqx/emqx:4.4.11 +ARG STATIC_CONFIG_PATH=/opt/emqx/lib/emqx_dashboard-4.4.10/priv/www/static/ + +# 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/ + 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"] \ No newline at end of file +ENTRYPOINT ["sh", "/opt/emqx/bin/emqx", "foreground"] \ No newline at end of file diff --git a/configs/emqx_exhook.conf b/configs/emqx_exhook.conf index 6bb3a63..2804d78 100644 --- a/configs/emqx_exhook.conf +++ b/configs/emqx_exhook.conf @@ -48,7 +48,7 @@ ## The gRPC server url ## ## exhook.server.$name.url = url() -exhook.server.default.url = http://host.docker.internal:9000 +exhook.server.default.url = http://switch-gear:9000 #exhook.server.default.ssl.cacertfile = etc/certs/cacert.pem #exhook.server.default.ssl.certfile = etc/certs/cert.pem diff --git a/data/loaded_plugins b/data/loaded_plugins new file mode 100644 index 0000000..492bf24 --- /dev/null +++ b/data/loaded_plugins @@ -0,0 +1,9 @@ +{emqx_management,true}. +{emqx_dashboard,true}. +{emqx_modules,false}. +{emqx_retainer,true}. +{emqx_recon,true}. +{emqx_telemetry,true}. +{emqx_rule_engine,true}. +{emqx_bridge_mqtt,false}. +{emqx_exhook,true}. diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index de15cd3..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -echo "copying static content" -STATIC_CONFIG_PATH=/opt/emqx/lib/emqx_dashboard-4.4.10/priv/www/static/ -cp /opt/emqx/static/css/* $STATIC_CONFIG_PATH/css/ -cp /opt/emqx/static/img/* $STATIC_CONFIG_PATH/img/ - -cp /opt/emqx/configs/emqx_exhook.conf /opt/emqx/etc/plugins/ - -echo "Starting server.." -sh /opt/emqx/bin/emqx foreground