2020-04-06 03:14:02 +00:00
|
|
|
FROM node:12-alpine
|
2019-10-31 10:04:50 +00:00
|
|
|
|
2020-02-20 21:55:38 +00:00
|
|
|
# dependencies: log filtering
|
|
|
|
RUN apk add --update jq \
|
|
|
|
&& rm -rf /var/cache/apk/* \
|
|
|
|
&& yarn global add bunyan
|
|
|
|
ENV PATH="${PATH}:$(yarn global bin)"
|
|
|
|
|
2021-03-29 15:13:57 +00:00
|
|
|
WORKDIR /salty-dog
|
|
|
|
|
2019-10-31 10:04:50 +00:00
|
|
|
# copy config, which changes rarely
|
|
|
|
COPY docs/config-docker.yml /root/.salty-dog.yml
|
|
|
|
|
|
|
|
# copy package first, to invalidate other layers when version changes
|
|
|
|
COPY package.json /salty-dog/package.json
|
2021-03-29 15:13:57 +00:00
|
|
|
RUN yarn install --production
|
2019-10-31 10:04:50 +00:00
|
|
|
|
|
|
|
# copy chunks, largest to smallest (entrypoint)
|
|
|
|
COPY out/vendor.js /salty-dog/out/vendor.js
|
|
|
|
COPY out/main.js /salty-dog/out/main.js
|
|
|
|
COPY out/index.js /salty-dog/out/index.js
|
|
|
|
|
|
|
|
# set up as global cli tool
|
|
|
|
RUN yarn global add file:$(pwd)
|
|
|
|
|
|
|
|
COPY rules /salty-dog/rules
|
|
|
|
|
|
|
|
ENTRYPOINT [ "node", "/salty-dog/out/index.js" ]
|
2021-03-29 15:13:57 +00:00
|
|
|
CMD [ "--help" ]
|