1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

Merge branch 'master' of https://github.com/thingsboard/thingsboard-gateway into develop/2.4-python

This commit is contained in:
zbeacon
2020-01-15 12:50:35 +02:00
2 changed files with 24 additions and 19 deletions

View File

@@ -3,16 +3,33 @@ FROM ubuntu:18.04
RUN apt-get update && apt-get -y install sudo
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y tzdata
RUN apt-get install -y tzdata wget
COPY python3-thingsboard-gateway.deb /
COPY start-gateway.sh /usr/bin/
COPY config/ /default-config/config/
COPY extensions/ /default-config/extensions/
RUN chmod +x /usr/bin/start-gateway.sh
#COPY python3-thingsboard-gateway.deb /
RUN wget https://github.com/thingsboard/thingsboard-gateway/releases/latest/download/python3-thingsboard-gateway.deb
RUN sudo apt-get install -y /python3-thingsboard-gateway.deb
RUN echo '#Main start script\n\
CONF_FOLDER="/etc/thingsboard-gateway/config"\n\
firstlaunch=${CONF_FOLDER}/.firstlaunch\n\
\n\
if [ ! -f ${firstlaunch} ]; then\n\
cp -r /default-config/config/* /etc/thingsboard-gateway/config/\n\
cp -r /default-config/extensions/* /var/lib/thingsboard_gateway/extensions/\n\
touch ${firstlaunch}\n\
echo "#Remove this file only if you want to recreate default config files! This will overwrite exesting files" > ${firstlaunch}\n\
fi\n\
\n\
/usr/bin/python3 -c "from thingsboard_gateway.tb_gateway import daemon; daemon()"\n'\
>> start-gateway.sh
RUN cp start-gateway.sh /usr/bin/
RUN chmod +x /usr/bin/start-gateway.sh
RUN mkdir -p /default-config/config /default-config/extensions/
RUN cp -r /etc/thingsboard-gateway/config/* /default-config/config/
RUN cp -r /var/lib/thingsboard_gateway/extensions/* /default-config/extensions/
ENV configs /etc/thingsboard-gateway/config
ENV extensions /var/lib/thingsboard_gateway/extensions
ENV logs /var/log/thingsboard-gateway

View File

@@ -1,12 +0,0 @@
#
CONF_FOLDER="/etc/thingsboard-gateway/config"
firstlaunch=${CONF_FOLDER}/.firstlaunch
if [ ! -f ${firstlaunch} ]; then
cp -r /default-config/config/* /etc/thingsboard-gateway/config/
cp -r /default-config/extensions/* /var/lib/thingsboard_gateway/extensions/
touch ${firstlaunch}
echo "#Remove this file only if you want to recreate default config files! This will overwrite exesting files" > ${firstlaunch}
fi
/usr/bin/python3 -c "from thingsboard_gateway.tb_gateway import daemon; daemon()"