47 lines
1.1 KiB
Docker
47 lines
1.1 KiB
Docker
FROM node:current-buster-slim
|
|
|
|
# Set the commit of Zwave2Mqtt to checkout when cloning the repo
|
|
ENV Z2M_VERSION=9cc3740740b57f1e896139b5ffdb25be7576ad58
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
# Install required dependencies
|
|
RUN apt update -y && \
|
|
apt full-upgrade -y && \
|
|
apt autoremove -y && \
|
|
apt clean -y
|
|
|
|
RUN apt install -y \
|
|
socat libopenzwave1.5 npm git
|
|
|
|
# Clone Zwave2Mqtt build pkg files and move them to /dist/pkg
|
|
RUN npm config set unsafe-perm true && npm install -g pkg \
|
|
&& cd /root \
|
|
&& git clone https://github.com/OpenZWave/Zwave2Mqtt.git \
|
|
&& cd Zwave2Mqtt \
|
|
&& git checkout ${Z2M_VERSION} \
|
|
&& npm install \
|
|
&& npm run build
|
|
|
|
# Clean up
|
|
RUN rm -rf /root/* && \
|
|
apt-get clean -y && \
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
COPY --from=build /dist/lib/ /lib/
|
|
COPY --from=build /dist/pkg /usr/src/app
|
|
|
|
# supervisor base configuration
|
|
ADD supervisor.conf /etc/supervisor.conf
|
|
|
|
LABEL maintainer="zoide"
|
|
|
|
# Set enviroment
|
|
ENV LD_LIBRARY_PATH /lib
|
|
|
|
EXPOSE 8091
|
|
|
|
CMD ["supervisord", "-c", "/etc/supervisor.conf"]
|
|
#CMD ["/usr/src/app/zwave2mqtt"]
|
|
|