pushdeer/docker/mqtt/Dockerfile

23 lines
575 B
Docker
Raw Normal View History

2022-02-23 17:50:40 +08:00
FROM node:16-alpine3.15
2022-03-23 21:15:09 +08:00
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN sed -i 's/dl-4.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
2022-02-23 17:50:40 +08:00
RUN apk --no-cache add mosquitto mosquitto-clients
RUN npm install -g forever
ADD mosquitto.conf /mosquitto.conf
2022-03-24 18:36:57 +08:00
RUN /usr/sbin/mosquitto -c /mosquitto.conf -v -d
2022-02-23 17:50:40 +08:00
# 测试时注释掉下一行
COPY api /api
COPY init.sh /init.sh
RUN chmod +x /init.sh
EXPOSE 1883
2022-03-24 18:36:57 +08:00
EXPOSE 9001
2022-02-23 17:50:40 +08:00
EXPOSE 80
ENTRYPOINT ["/bin/sh", "/init.sh"]
# ENTRYPOINT ["/usr/sbin/mosquitto", "-c", "/mosquitto.conf",""]