Use node:16-slim for final image build (#336)

* Use node:16-slim for final image build

* changelog

* Add ignore scripts to final install step
This commit is contained in:
Will Hunt 2022-05-06 15:54:45 +01:00 committed by GitHub
parent b23e516aa5
commit eea075e7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -16,14 +16,15 @@ RUN node node_modules/esbuild/install.js
RUN yarn build --pure-lockfile
# Stage 1: The actual container
FROM node:16
FROM node:16-slim
COPY --from=builder /src/lib/ /bin/matrix-hookshot/
COPY --from=builder /src/public/ /bin/matrix-hookshot/public/
COPY --from=builder /src/package.json /bin/matrix-hookshot/
COPY --from=builder /src/yarn.lock /bin/matrix-hookshot/
WORKDIR /bin/matrix-hookshot
RUN yarn --production --pure-lockfile && yarn cache clean
# --ignore-scripts so we don't try to build
RUN yarn --ignore-scripts --production --pure-lockfile && yarn cache clean
VOLUME /data
EXPOSE 9993

1
changelog.d/336.misc Normal file
View File

@ -0,0 +1 @@
The docker image has been shrunk by 78%, and now takes up 300MB.