1
0
Fork 0

fix(image): remove yargs from bundle, add to image

This commit is contained in:
ssube 2021-03-29 10:13:57 -05:00
parent 50bdfba8e3
commit 14a51eefaa
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 11 additions and 6 deletions

View File

@ -6,11 +6,14 @@ RUN apk add --update jq \
&& yarn global add bunyan
ENV PATH="${PATH}:$(yarn global bin)"
WORKDIR /salty-dog
# 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
RUN yarn install --production
# copy chunks, largest to smallest (entrypoint)
COPY out/vendor.js /salty-dog/out/vendor.js
@ -18,10 +21,9 @@ COPY out/main.js /salty-dog/out/main.js
COPY out/index.js /salty-dog/out/index.js
# set up as global cli tool
WORKDIR /salty-dog
RUN yarn global add file:$(pwd)
COPY rules /salty-dog/rules
ENTRYPOINT [ "node", "/salty-dog/out/index.js" ]
CMD [ "--help" ]
CMD [ "--help" ]

View File

@ -7,11 +7,14 @@ RUN apt-get update -y \
&& yarn global add bunyan
ENV PATH="${PATH}:$(yarn global bin)"
WORKDIR /salty-dog
# 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
RUN yarn install --production
# copy chunks, largest to smallest (entrypoint)
COPY out/vendor.js /salty-dog/out/vendor.js
@ -19,10 +22,9 @@ COPY out/main.js /salty-dog/out/main.js
COPY out/index.js /salty-dog/out/index.js
# set up as global cli tool
WORKDIR /salty-dog
RUN yarn global add file:$(pwd)
COPY rules /salty-dog/rules
ENTRYPOINT [ "node", "/salty-dog/out/index.js" ]
CMD [ "--help" ]
CMD [ "--help" ]

View File

@ -96,10 +96,11 @@
"tslint-clean-code": "0.2.10",
"tslint-microsoft-contrib": "6.2.0",
"tslint-sonarts": "1.9.0",
"typescript": "4.2.3",
"typescript": "4.2.3"
},
"dependencies": {
"yargs": "16.2.0"
},
"dependencies": {},
"nyc": {
"extends": "@istanbuljs/nyc-config-typescript"
},