mirror of
https://repository.entgra.net/community/entgra-emqx-docker.git
synced 2025-09-16 23:42:18 +00:00
Compare commits
4 Commits
v4.4.11-en
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf9dd2a589 | ||
|
|
6e6fcc2286 | ||
|
|
1cbbc962fb | ||
|
|
aaa2da78b3 |
@ -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/
|
ARG STATIC_CONFIG_PATH=/opt/emqx/lib/emqx_dashboard-4.4.10/priv/www/static/
|
||||||
|
|
||||||
|
USER root
|
||||||
# Copy static files
|
# Copy static files
|
||||||
COPY /static/css/* ${STATIC_CONFIG_PATH}/css/
|
COPY /static/css/* ${STATIC_CONFIG_PATH}/css/
|
||||||
COPY /static/img/* ${STATIC_CONFIG_PATH}/img/
|
COPY /static/img/* ${STATIC_CONFIG_PATH}/img/
|
||||||
|
|
||||||
# Copy configuration and data files
|
# Copy configuration and data files to the container
|
||||||
COPY /configs/emqx_exhook.conf /opt/emqx/etc/plugins/
|
COPY /configs/emqx_exhook.conf /opt/emqx/configs/
|
||||||
COPY /data/loaded_plugins /opt/emqx/data/
|
COPY /data/loaded_plugins /opt/data/
|
||||||
|
|
||||||
EXPOSE 1883 8083 8084 8883 11883 18083 4370 5369
|
EXPOSE 1883 8083 8084 8883 11883 18083 4370 5369
|
||||||
|
|
||||||
COPY ./entrypoint.sh /opt/emqx/bin/entrypoint.sh
|
COPY ./entrypoint.sh /opt/emqx/bin/entrypoint.sh
|
||||||
USER root
|
|
||||||
RUN chmod +x /opt/emqx/bin/entrypoint.sh
|
RUN chmod +x /opt/emqx/bin/entrypoint.sh
|
||||||
ENTRYPOINT ["/opt/emqx/bin/entrypoint.sh"]
|
ENTRYPOINT ["/opt/emqx/bin/entrypoint.sh"]
|
||||||
|
|||||||
@ -16,10 +16,35 @@
|
|||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
CONFIG_PATH=/opt/emqx/etc/plugins/emqx_exhook.conf
|
CONFIG_PATH=/opt/emqx/configs/emqx_exhook.conf
|
||||||
|
EMQX_DATA_PATH=/opt/emqx/data/loaded_plugins
|
||||||
|
|
||||||
# Set emqx_exhook.conf configs
|
if [ -f "$CONFIG_PATH" ]
|
||||||
sed -i 's/${SERVER_HOSTNAME}/'$SERVER_HOSTNAME'/g' $CONFIG_PATH
|
then
|
||||||
|
echo "$CONFIG_PATH found. Populating templates"
|
||||||
|
# Backup config files
|
||||||
|
cp $CONFIG_PATH $CONFIG_PATH.template
|
||||||
|
CONFIG_TEMPLATE_PATH=$CONFIG_PATH.template
|
||||||
|
|
||||||
|
echo "Setting up configurations"
|
||||||
|
# emqx_exhook.conf
|
||||||
|
sed -i 's/${SERVER_HOSTNAME}/'$SERVER_HOSTNAME'/g' $CONFIG_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy configuration and data file
|
||||||
|
cp $CONFIG_PATH /opt/emqx/etc/plugins/emqx_exhook.conf
|
||||||
|
|
||||||
|
rm -f $EMQX_DATA_PATH
|
||||||
|
cp /opt/data/loaded_plugins $EMQX_DATA_PATH
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f "$CONFIG_PATH" ]
|
||||||
|
then
|
||||||
|
# Removing edited files
|
||||||
|
rm -f $CONFIG_PATH
|
||||||
|
# Reverting template files to originals
|
||||||
|
mv $CONFIG_TEMPLATE_PATH $CONFIG_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Starting server.."
|
echo "Starting server.."
|
||||||
sh /opt/emqx/bin/emqx foreground
|
sh /opt/emqx/bin/emqx foreground
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user