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