mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-01 09:31:39 +00:00
34 lines
850 B
Docker
34 lines
850 B
Docker
FROM node:16-alpine3.15 as base
|
|
|
|
WORKDIR /app
|
|
RUN apk add --no-cache tzdata eudev tini
|
|
|
|
# Dependencies and build
|
|
FROM base as dependencies_and_build
|
|
|
|
COPY package*.json tsconfig.json index.js ./
|
|
COPY lib ./lib
|
|
|
|
RUN apk add --no-cache --virtual .buildtools make gcc g++ python3 linux-headers git && \
|
|
npm ci --production --no-audit --no-optional --no-update-notifier && \
|
|
apk del .buildtools
|
|
|
|
# Release
|
|
FROM base as release
|
|
|
|
COPY --from=dependencies_and_build /app/node_modules ./node_modules
|
|
COPY dist ./dist
|
|
COPY package.json LICENSE 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 "$COMMIT" > dist/.hash
|
|
|
|
ENV NODE_ENV production
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD [ "/sbin/tini", "--", "node", "index.js"] |