zigbee2mqtt/docker/Dockerfile

34 lines
703 B
Docker
Raw Normal View History

2020-10-09 04:55:36 -07:00
FROM node:12-alpine3.12 as base
2018-05-09 13:15:59 -07:00
WORKDIR /app
RUN apk add --no-cache tzdata eudev
2018-05-09 13:15:59 -07:00
COPY package.json ./
2018-06-15 15:10:08 -07:00
# Dependencies
FROM base as dependencies
COPY npm-shrinkwrap.json ./
2020-10-09 06:20:05 -07:00
RUN apk add --no-cache --virtual .buildtools make gcc g++ python3 linux-headers git && \
npm ci --production && \
apk del .buildtools
2018-05-09 13:15:59 -07:00
# Release
FROM base as release
COPY --from=dependencies /app/node_modules ./node_modules
COPY lib ./lib
COPY index.js data/configuration.yaml ./
COPY docker/docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN mkdir /app/data
ARG COMMIT
RUN echo "{\"hash\": \"$COMMIT\"}" > .hash.json
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["npm", "start"]