start script

This commit is contained in:
Wolfgang Hottgenroth 2019-06-27 14:42:33 +02:00
parent 31eeece65b
commit e550da0b85
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
2 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,10 @@ ENV BROKER "mqtt://127.0.0.1"
ENV DATA_DIR "/opt/app"
ENV STORAGE_DIR "/opt/app/storage"
COPY start.sh /usr/local/bin/
RUN \
chmod 755 /usr/local/bin/start.sh && \
npm install -g homekit2mqtt --unsafe-perm && \
mkdir -p ${DATA_DIR} && \
touch ${DATA_DIR}/mapping.json && \
@ -19,6 +22,6 @@ VOLUME ${DATA_DIR}
EXPOSE 51826
EXPOSE 51888
CMD [ "homekit2mqtt", "-m", "$DATA_DIR/mapping.json", "-u", "$BROKER", "-s", "$STORAGE_DIR", "--insecure", "--pincode=$PIN" ]
CMD [ "/usr/local/bin/start.sh" ]

4
start.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
/usr/local/bin/homekit2mqtt -m $DATA_DIR/mapping.json -u $BROKER --insecure -c $PIN